【发布时间】:2014-04-07 21:38:45
【问题描述】:
试图结帐到另一个分支
我有一个带有
的 .gitignore 文件.someFile
即使我没有任何更改,尝试结帐到另一个分支也会失败
dev@cool:~/proj/source$ git status
# On branch master
nothing to commit, working directory clean
dev@cool:~/proj/source$ git checkout someBranchName
error: Your local changes to the following files would be overwritten by checkout:
.someFile
Please, commit your changes or stash them before you can switch branches.
Aborting
dev@cool:~/proj/source$
从 .gitignore 中删除文件并再次添加没有帮助
运行命令:
git update-index --assume-unchanged .someFile
或
git rm --cached .someFile
没有帮助
有什么想法吗?
【问题讨论】:
-
你确定你有
.gitignroe而不是.gitignore吗?
标签: git git-branch gitignore git-checkout