Checkout another branch when there are uncommitted changes on the current branch

前端 未结 5 2054
北恋
北恋 2020-11-21 06:10

Most of the time when I try to checkout another existing branch, Git doesn\'t allow me if I have some uncommitted changes on the current branch. So I\'ll have to commit or s

5条回答
  •  醉酒成梦
    2020-11-21 06:39

    The correct answer is

    git checkout -m origin/master

    It merges changes from the origin master branch with your local even uncommitted changes.

提交回复
热议问题