我想切换分支,但是出现了错误。
error: Untracked working tree file 'foo.phtml' would be overwritten by merge.
如果我删除这个文件,下一个文件就会出现问题。问题在于这两个分支中的文件有很大的差异。
这是我尝试过的:
$ git reset --hard HEAD
HEAD is now at 8a2a95c Initial checkin
$ git checkout otherbranch
error: Untracked working tree file 'foo.phtml' would be overwritten by merge.
$ git status
# On branch master
# Your branch and 'origin/master' have diverged,
# and have 1 and 677 different commit(s) each, respectively.
#
nothing to commit (working directory clean)
这里有什么问题?
我也已经尝试过了。
git clean -f -d
.gitignore
文件可能会覆盖它们。 - mavam