Levente Bagi

Switching Git Branches the Lazy Way

Ever been tired of typing git checkout my-awesome-feature? You can set up an alias and an autocompletion, but you will still have to type git co my<TAB> and remember the beginning of the branch name.

At work, we typically use long, descriptive branch names, and I can only remember 1 or 2 words that are in it.

So I’ve written a little script that finds the correct branch based on the keyword and switches to it. If there’s any ambiguity it will ask me, and I will have to enter a number.

git

Comments