GIT: Do I need to commit my branch before checking out another branch, what about stashing?

后端 未结 2 489
既然无缘
既然无缘 2021-01-01 17:51

I\'m new to Git and a bit confused. I have a Master branch and have created a second feature branch.

If I make changes in my feature branch and then switch to Mas

2条回答
  •  既然无缘
    2021-01-01 18:27

    You probably don't want to use stash for this purpose.

    If you really want to be developing on the master and a feature branch at the same time, I suggest cloning your repository, working in the clone and the master, and then using push and pull to move changes between them.

    If you are switching frequently between them, I suggest checking in before you switch; there's nothing wrong with checking in garbage; git makes it easy to sort this out later on.

提交回复
热议问题