gpt4 book ai didi

git - 错误 : The following untracked working tree files would be overwritten by merge: .

转载 作者:太空狗 更新时间:2023-10-29 13:12:16 26 4
gpt4 key购买 nike

我正在使用 Angular JS 开发网络应用程序。提交后,我试图在推送我的最新更改之前 pull 其他 Web 开发人员的最新版本以将其与我的 merge 。我收到此错误并且不知道为什么会发生这种情况,因为我在之前的 pull/推中没有遇到任何问题。

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

最佳答案

您似乎已经创建了一个本地 .gitignore 文件,但尚未将其提交到存储库,并且您尝试与之交互( pull/推)的远程现在有一个 .gitignore 。发生这种情况时,您的存储库中的任何文件都是这种情况

因为 .gitignore 不仅仅是任何文件,它会影响 git 的行为方式,我会手动比较两者,创建一个文件,它是两者的联合,提交它然后 merge ,修复可能存在的任何格式问题。

这些可能是完全相同的文件,但 git 不会知道,因为您没有在本地添加它。这不是您希望经常更改的文件,因为它会使 checkout 行为不同。

Github 维护 a list of useful .gitignore templates对于大多数语言。

关于git - 错误 : The following untracked working tree files would be overwritten by merge: .,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/21915379/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com