You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I use the JIRA issue id (e.g. ISPN-12345) as a prefix for all my task branches, and gco ISPN-12345_task fails:
Invalid argument: 'ISPN'
~/.config/fish/functions/gco.fish (line 46):
if [ $first -lt $last ]
^
in function '__gco' with arguments 'ISPN-12345_task'
called on line 75 of file ~/.config/fish/functions/gco.fish
in function 'gco' with arguments 'ISPN-12345_task'
Argument is not valid.
The text was updated successfully, but these errors were encountered:
Hi @danberindei, thank you for raising this issue!
The gco function also supports branch names with hyphens, but it doesn't detect them automatically. You can enable support for hyphened branch names by un-commenting line 27. However, this will disable the ability to pass in ranges of numbers, like gco 1-5.
What I usually do instead is run gb first and then use the assigned number to gco the branch I want. This also works for branches with hyphened names.
Another alternative is to use git checkout directly when switching branches; tab-completion works for that, plus you could even create an abbreviation for it like abbr -a gch 'git checkout' (that's what I did) to make things even easier.
I didn't follow up the issue because I ended up using git switch for more branch-related stuff (aliased to gw). gb has the same issue and it's a bit annoying when I want to rename a branch and automatically type gb -m new-name, but I use that a lot less often so it's not too bad.
I use the JIRA issue id (e.g.
ISPN-12345
) as a prefix for all my task branches, andgco ISPN-12345_task
fails:Invalid argument: 'ISPN'
~/.config/fish/functions/gco.fish (line 46):
if [ $first -lt $last ]
^
in function '__gco' with arguments 'ISPN-12345_task'
called on line 75 of file ~/.config/fish/functions/gco.fish
in function 'gco' with arguments 'ISPN-12345_task'
Argument is not valid.
The text was updated successfully, but these errors were encountered: