我在StackOverflow上搜索了类似的问题,但似乎总是有人试图从其分支机构升级为master。对我来说恰恰相反。我在master上,试图结帐到已经推送的分支。
当我这样做时:
git checkout mybranch
我得到:
error: Your local changes to the following files would be overwritten by checkout:
db/structure.sql
Please commit your changes or stash them before you switch branches.
Aborting
我尝试过:
git checkout -f mybranch
但我收到消息:
error: Entry 'db/structure.sql' not uptodate. Cannot merge.
如果我尝试隐藏或提交,则没有区别:
git stash
No local changes to save
git checkout mybranch
error: Your local changes to the following files would be overwritten by checkout:
db/structure.sql
Please commit your changes or stash them before you switch branches.
Aborting
或
git commit
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
git checkout mybranch
error: Your local changes to the following files would be overwritten by checkout:
db/structure.sql
Please commit your changes or stash them before you switch branches.
Aborting
git submodule status
不返回任何内容,而git status -u
返回:
On branch master
Your branch is up to date with 'origin/master'.
nothing to commit, working tree clean
有关如何解决此问题的任何建议?