Why do I have to stash / commit my changes before switching branches?

前端 未结 4 2073
不思量自难忘°
不思量自难忘° 2021-01-18 19:14

I find this to be annoying because I would like to quickly switch branches and do something and then switch back to what I was working on before. I realize I can stash and t

4条回答
  •  清酒与你
    2021-01-18 20:06

    This is actually a solution for one of your problems but you can add a message to each stash in order to know which stash belongs to which branch. Doing it so you will allways easily know which branches have a stash and which don't.

    For doing this just use this command:

    git stash save -u branch1
    

    where 'branch1' is the message or name that you give the stash

提交回复
热议问题