Suppose you maintain 2 branches, dev and release.
Other then discipline, how do you force yourself to not make changes in release and checkout to dev?
Q1: If you forgot to do it and made changes in release, is there a way to commit them to dev instead and abort in release?
Q2: Are there any common tricks people use to avoid making tons of changes in branch that was not designed for it?
Q1: Yeah, that’s pretty simple. If you’ve realized you committed to the wrong branch:
Q2: I rely heavily on git-completion:
https://github.com/git/git/blob/master/contrib/completion/git-completion.bash