Error when changing to master branch: my local changes would be overwritten by checkout

后端 未结 6 1984
难免孤独
难免孤独 2020-11-30 19:20

This question is similar to this one, but more specific.

I have a project with two branches (staging and beta).

I develop

6条回答
  •  感情败类
    2020-11-30 19:46

    I encountered the same problem and solved it by

    git checkout -f branch

    Well, be careful with the -f switch. You will lose any uncommitted changes if you use the -f switch. While there may be some use cases where it is helpful to use -f, in most cases, you may want to stash your changes and then switch branches. The stashing procedure is explained above.

提交回复
热议问题