Search code examples
zshoh-my-zsh

select git branch on ZSH


I use oh-my-zsh for my main terminal on linuxmint 21, when I run command gb or git branch, I got this result:

  boba
* main
(END)

I use zsh from this tutorial: FROM HERE

And this is the cheat sheet: CHEATSHEET COMMAND

Can I choose the boba branch in this situation?


Solution

  • EDIT: Completely different answer after clarification of problem.

    That's because the command you ran lists the available branches using a pager.

    The one marked with '*' is the current branch, and the "(END)" is how a pager tells you that the previous was the last line.

    You cannot use the pager to switch branches. To switch you use

    git checkout boba
    

    With all the bells and whistles oh-my-zsh incorporates, you may bring up a selection widget by typing Tab after the checkout arg:

    git checkout <TAB>
    

    (I don't use oh-my-zsh so it may not work).