Git asks me to commit or stash changes on checkout master, even though all changes were committed?

前端 未结 8 1712
误落风尘
误落风尘 2020-12-28 12:48

I have two branches locally, master and Berislav. The latter is currently active, and I have committed all the changes. When I try to checkout to <

相关标签:
8条回答
  • 2020-12-28 13:15

    As simple as this:

    git stash
    git stash pop
    

    The "errors" you see when running git stash aren't anything to be concerned about. It's just git recognizing that the file doesn't have any uncommitted changes.

    0 讨论(0)
  • 2020-12-28 13:18

    I had a similar problem on a fresh clone. I just forced the checkout with the --force (-f) flag

    git checkout --force some_branch 
    

    Probably not the best way of resolving the issue on a repo that you are making changes to, but in my case I was sure I hadn't made any changes, and just wanted to switch branch.

    0 讨论(0)
提交回复
热议问题