让我介绍一个场景-我正在进行回购,在
my_branch
分支,我需要合并来自
other_branch
我的分公司。
我执行命令:
git merge origin/feature/other_branch
这是一个样品
git status
运行此命令后:
$ git status
On branch feature/my_branch
Your branch is up-to-date with 'origin/feature/my_branch'.
You have unmerged paths.
(fix conflicts and run "git commit")
Changes to be committed:
modified: file1
modified: file2
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: file3
both modified: file4
Changes not staged for commit:
(use "git add <file>..." to update what will be committed)
(use "git checkout -- <file>..." to discard changes in working directory)
modified: file5
modified: file6
Untracked files:
(use "git add <file>..." to include in what will be committed)
file7
file8
如您所见,更改为
file1
和
file2
已被接受
其他分支机构
并已准备好提交。
我在中遇到合并冲突
file3
和
file4
,这是我在编辑器上手动修复的。
我对
file5
和
file6
但是我还不愿意承担那些…
我已经添加了
file7
和
file8
到工作区,但我也不愿意承诺这些。
要将冲突文件添加到阶段,我需要运行:
git add file1
git add file2
有什么旗子吗
在里面
git add
,我只能使用其中的文件
both modified
状态,同时忽略已修改和未保存的文件?
谢谢