git - 以下未跟踪的工作树文件将被 merge : . gitignore 覆盖 请在 merge 之前移动或删除它们

标签 git merge

我已经被这个问题困扰了至少一个小时。我正在尝试使用命令 git pull pull 文件。

error: The following untracked working tree files would be overwritten by merge:
    .gitignore
Please move or remove them before you can merge.
Aborting

我尝试使用 rm .gitignore 将其从本地 map 中删除。

最佳答案

您好,欢迎来到 Stack Overflow,

我也有这个问题..输出让我感到惊讶:

error: The following untracked working tree files would be overwritten by merge:
index.php
Please move or remove them before you can merge.

我了解到这是因为您进行了本地修改,导致无法 merge 。

我读过一个解决方案是重置回头部:

git reset --hard HEAD

然后再次 pull :

git pull

您也可以考虑先提交或存储您自己的更改。

我不确定,但您是否已经看过这个问题:git - strange branch merge error that I am not sure how to solve ? 看起来 Genadinik 也有同样的问题。

祝你好运!希望对你有帮助

关于git - 以下未跟踪的工作树文件将被 merge : . gitignore 覆盖 请在 merge 之前移动或删除它们,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28721185/

相关文章:

java - 如何使用github的代码库?

python - 删除重复行但保留某些值 Pandas

svn - 使用 TortoiseSVN 合并时如何处理树冲突,以防文件夹被删除?

database - H2 db 中的合并查询显示 null not allowed 错误

r - 合并数据帧,优先级高于另一个

git - 使用 Teamcity 从同一分支构建和部署不同的项目

Git:为什么删除后还能切换到分支?

linux - 在两个不同的 git repos 中的文件之间获取差异并应用于第一个 repo

Git-nullSha1 : contains entries pointing to null sha1

git - merge 分支以掌握所有更改?