How to sparsely checkout only one single file from a git repository?

前端 未结 21 1597
Happy的楠姐
Happy的楠姐 2020-11-22 08:14

How do I checkout just one file from a git repo?

21条回答
  •  礼貌的吻别
    2020-11-22 08:45

    If you have edited a local version of a file and wish to revert to the original version maintained on the central server, this can be easily achieved using Git Extensions.

    • Initially the file will be marked for commit, since it has been modified
    • Select (double click) the file in the file tree menu
    • The revision tree for the single file is listed.
    • Select the top/HEAD of the tree and right click save as
    • Save the file to overwrite the modified local version of the file
    • The file now has the correct version and will no longer be marked for commit!

    Easy!

提交回复
热议问题