2

Here's something I want: A git command that shows me the last 5 branches I had checked out, and then prompts me to choose one of them to check it out. This would be helpful to me, since I often switch between a handful of branches, and sometimes I want to check out a branch whose name I forgot.

Does something like this exist? Otherwise I might make a little open-source project for it :)

Edit: I don't want to just see the list of recent branches, I want to have a selector UI in the shell, using the up and down arrow keys, and then pressing Enter to choose the branch and check it out.

Ram Rachum
  • 84,019
  • 84
  • 236
  • 374
  • It is not answer to your question, but I hope it will be useful. You can use `zsh` with `git` plugin. It autocomplete names of branches by `tab` key. – ceth Apr 12 '20 at 15:05
  • 1
    I hope the below link might help you. https://stackoverflow.com/questions/25095061/how-can-i-get-a-list-of-git-branches-that-ive-recently-checked-out][1] – Vikash Apr 12 '20 at 15:10
  • You can search the command-line history for recent `git checkout` or `git switch` commands. For example `history | grep 'git (checkout|switch)'. – matt Apr 12 '20 at 15:10

0 Answers0