Git: move changes off of master branch

后端 未结 6 466
南旧
南旧 2021-02-03 20:53

Basic question but this happens to me all the time:

  • Make changes in a working-branch
  • Switch to master
  • git merg
6条回答
  •  悲哀的现实
    2021-02-03 21:35

    I generally recommend the following Git setting:

    git config push.default nothing
    

    With this, you will at least have to name the branch when you push. It won't stop you from committing to master locally, but when you realize you have, you can move those commits to a branch without affecting anyone else.

提交回复
热议问题