wfxr / forgit

:zzz: A utility tool powered by fzf for using git interactively.
MIT License
4.32k stars 136 forks source link

checkout_branch: support "-" argument #322

Closed carlfriedrich closed 10 months ago

carlfriedrich commented 10 months ago

git natively supports - as an argument to git switch and git checkout. It is shorthand for @{-1}, which is a way to refer to the last branch you were on.

forgit used to interpret - as a branch name, detect that it does not exist yet and create a new one with this name, which does not work.

Add a check whether - is passed on the command line and do not create a new branch in this case

Check list

Description

Type of change

Test environment