在我进行了一些更改branch1并提交之后,我正在尝试结帐branch2:
>>git checkout branch2
error: Your local changes to the following files would be overwritten by checkout:
.gitignore
Please, commit your changes or stash them before you can switch branches.
Aborting
但我在更新的文件中没有看到任何.gitignore文件:
>>git status
On branch branch1
Your branch is ahead of 'origin/branch1' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working directory clean
>>git stash
No local changes to save
我也试过
>>git checkout branch2 -f
但得到了
error: Entry '.gitignore' not uptodate. Cannot merge.
和
>>git rm --cached .gitignore
没有成功
我怎样才能强行结帐以branch2忽略这一点"error: Your local changes to the following files would be overwritten by checkout"?