且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何使用Git和命令行在合并期间保留本地文件或远程文件?

更新时间:2023-09-26 18:29:16

你也可以这样做:

git checkout --theirs /path/to/file

保留远程文件,以及:

git checkout --ours /path/to/file

保存本地文件.

然后 git add 它们就完成了.

Then git add them and everything is done.

版本:请记住,这是针对 merge 场景的.在 rebase 期间,--theirs 指的是你一直工作的分支.

Edition: Keep in mind that this is for a merge scenario. During a rebase --theirs refers to the branch where you've been working.