DEV Community

loading...

Easily checkout branch from checkout history with git-checkout-history

Ahmy Yulrizka
just your regular programmer
・1 min read

Screenshot

https://github.com/yulrizka/git-checkout-history

During development we sometime working on multiple branch at once. Switching between branches becoming a hassle because we need to specify the branch name each time.

To Make it easier, i created this git-checkout-history and with combination with fzf make changing branches a breeze. It remembers the order of the previous checkout so last checkout will come first. Changing branch also can done with up and down arrow and also support fuzzy search (you just need to type some part of the branch name).

If you like the idea, please try it and let me know if something does not work.

Tips: the command can be shorted with alias. Example for bash

$ alias gch="git checkout-history"
$ gch
Enter fullscreen mode Exit fullscreen mode

Discussion (0)