我调整了2个文件,然后去 merge 到Github。但是,当我运行推送时出现错误:
Unmerged paths:
# (use "git add/rm <file>..." as appropriate to mark resolution)
# deleted by us: somefolder/somefile.ext
但是,我没有动过这个文件。查看我的本地目录时,我发现该文件仍然完好无损。
有人知道为什么会发生这种情况以及我能做些什么吗?
最佳答案
参见“Who is “us” according to git?”
When you merge,
us
refers to the branch you're merging into, as opposed to them, the branch to be merged.
所以目标分支应该删除这个文件。
请参阅“git merge “deleted by us””以获取解决方案:您可以将其添加回去或将其删除。
作为torek details ,在这种情况下(您没有自己删除文件)中的“我们”表示 rebase (如 git pull --rebase
)。
参见“git rebase, keeping track of 'local' and 'remote'”
- 本地(“我们”)引用部分重新设置基数的提交:“我们的”(上游分支)
- 远程(“他们”)指的是传入的更改:“他们的”- rebase 之前的当前分支,即您没有删除该文件的分支。
关于git - 为什么 Git 说文件是 'deleted by us' 而我还没有碰它?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/44015527/