我想切换分支。但得到错误
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