2017-07-04 487 views
0

合并两个git分支之后,如果存在冲突,则可以使用命令git add *来解析哪个接受最新的代码的本地版本。我怎么能做这个命令的反面?为了给出一些背景知识,我有两个分支(为了方便起见,称它们为master和development),由于某种原因,git决定从我的开发分支中删除一些文件(git status,在这些文件前面写deleted by us:)。我试图合并主开发到开发(因为这些文件是唯一的差异),现在有冲突,不能使用git -add来解决,因为我不想松散这些文件。“git add”的相反命令是什么?

+0

不知道这将有助于https://gist.github.com/stevenyap/7511407 – grepLines

回答

1

您可以使用checkout并重新添加文件:

git checkout develop # go to develop branch first 
git checkout master -- fileYouWant # getting the file from master 
git add fileYouWant 
+1

救了我很多农业的 - 感谢 – CiaranWelsh

+0

乐意效劳! :) –