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

帅比萌擦擦* 提交于 2019-11-30 11:14:25

You can't change to another branch unless you clean your tree. This is done by committing your changes, reverting them or saving them to the stash.

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.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!