我想拉取除一个文件(下面是
GNUmakefile
)之外的所有更改。我查看了git-pull(3)
手册,但该选项对我来说不太清晰。
如何拉取所有更改,但跳过导致git出现问题的文件?是否有“忽略冲突文件”或“忽略文件X”等选项?
(最糟糕的是,GNUmakefile
在虚拟机之间被复制/粘贴,因此它们几乎是相同的文件。cryptopp-rw
的makefile在其末尾添加了一些依赖关系配方。)
cryptopp-rw$ git pull
remote: Counting objects: 7, done.
remote: Total 7 (delta 4), reused 4 (delta 4), pack-reused 3
Unpacking objects: 100% (7/7), done.
From https://github.com/weidai11/cryptopp
4206b4a..cf08f3e master -> origin/master
Updating 4206b4a..cf08f3e
error: Your local changes to the following files would be overwritten by merge:
GNUmakefile
Please, commit your changes or stash them before you can merge.
Aborting
git stash
),然后用git stash apply
将其放回拉取中。解决任何合并冲突。 - FDinoffmv
,这样就不需要阅读手册或与源代码控制工具打交道了。 - jwwgit fetch
(以及扩展的git pull
)是针对提交而不是文件进行操作的。它没有涉及个别文件的任何选项。 - Chris