当我执行 git status
时,它说 nothing to commit, working directory clean
然后我执行 git pull --rebase
,它说:
First, rewinding head to replay your work on top of it...
error: The following untracked working tree files would be overwritten by checkout:
includes/resources/moduledata/12/_Fr4_02_Invention_IPA_SR_la-Fête.pdf
Please move or remove them before you can switch branches.
Aborting
could not detach HEAD
执行 git pull origin master
时出现类似错误
* branch master -> FETCH_HEAD
error: The following untracked working tree files would be overwritten by merge:
includes/resources/moduledata/12/_Fr4_02_Invention_IPA_SR_la-Fête.pdf
Please move or remove them before you can merge.
Aborting
我的.gitignore
文件:
→ cat .gitignore
.htaccess
bower_components/
这个文件一直出现,当我从文件系统中删除它时,git 会说我删除了这个文件,而在其他消息中,它说它未被跟踪。怎么可能同时取消跟踪和跟踪呢?
最佳答案
这也可能由于文件名的大小写更改而发生。我遇到了同样的问题,这就是为我解决的问题。
git config core.ignorecase true
适用于 Mac 或 PC。
替代解决方案:The following untracked working tree files would be overwritten by checkout
关于git - 错误 : The following untracked working tree files would be overwritten by checkout,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/25392771/