Checkout a branch by its id

twitter logo github logo ・1 min read

When you're working on or peer reviewing or testing, etc more than 2 branches, it's difficult to remember the exact name of every branch and copy/paste is an inefficient option. So, since it's relatively easy to remember the number (id) of the story, we could come up with an alias or better a function to add to our .bashrc, .zshrc or wherever we keep our favourite aliases.

For that, we need to know the id of the branch we want to checkout.
E.g. if the branch is: prefix/PPRJ-123/name-of-the-task, then the id is 123.
Also, we assume the id is unique for the repository.


twitter logo DISCUSS
Classic DEV Post from Dec 25 '18

My 2018 Year in Review on

My favourite posts from the year ... in no particular order

Maria Michou profile image
Software Developer, mostly back-end, strong advocate for quality code.

👋 Hey reader.

Do you prefer sans serif over serif?

You can change your font preferences in the "misc" section of your settings. ❤️