我将分支狗合并为动物.当我去提交时,我得到以下内容:
Unmerged paths:
(use "git reset HEAD <file>..." to unstage)
(use "git add <file>..." to mark resolution
both deleted: ../public/images/originals/dog.ai
added by them: ../public/images/original_files/dog.ai
Run Code Online (Sandbox Code Playgroud)
总而言之,我在每个分支中都有不同的目录名和文件名.动物分支有我想要的变化.
当我重置头部时,它不起作用.当我去采取任何其他git动作(删除,结帐等)时,我得到一个路径未找到错误.
我需要执行哪些命令?
Cas*_*bel 72
你需要做的就是:
# if the file in the right place isn't already checked in
git add <path to desired file>
# remove the "both deleted" file from the index
git rm --cached ../public/images/originals/dog.ai
git commit # commit the merge
Run Code Online (Sandbox Code Playgroud)
nau*_*101 40
如果您的文件已经签入,并且您的文件已合并(但未提交,因此将合并冲突插入文件),则处理此情况的另一种方法是运行:
git reset
Run Code Online (Sandbox Code Playgroud)
这将切换到HEAD,并告诉git忘记任何合并冲突,并保持工作目录不变.然后,您可以编辑有问题的文件(搜索"更新的上游"通知).一旦处理完冲突,就可以运行了
git add -p
Run Code Online (Sandbox Code Playgroud)
这将允许您以交互方式选择要添加到索引的更改.一旦索引看起来很好(git diff --cached
),你可以提交,然后
git reset --hard
Run Code Online (Sandbox Code Playgroud)
销毁工作目录中所有不需要的更改.
归档时间: |
|
查看次数: |
120249 次 |
最近记录: |