My team works on separate branches and, commonly, I need to switch from branches quickly to help them. But I need to spend a lot of time finding which branch they are working on and I need to retype the whole branch names (and they are very long).
So I found a handy command that lets me get the branch name without cycling through the whole list:
git branch -a | find "72"
and it returns me this: remotes/origin/72-js-remove-the-player-from-the-game
. Our branch names always have the merge request number of GitLab in the front of the name, so it's always a unique number.
I would like to shorten this to a simple git find 20
. I thought that git CLI was similar to bash shell but to add aliases with arguments, I need to access .bashrc
(Which I'm unable to find for the Git CLI).
Also, I would like to maybe shorten the whole process of searching for a branch, retyping it into the CLI and switching to it with a single command similar to that (something like git qswitch 20
), if that's possible.