update git checkout remote shortcut function

This commit is contained in:
jc 2023-12-08 12:00:18 -05:00
commit b317cbe0e0
No known key found for this signature in database

View file

@ -179,7 +179,8 @@ gc() {
# fuzzy find remote branches and switch to selected branch # fuzzy find remote branches and switch to selected branch
gcr() { gcr() {
local selected_branch=$(git branch -r | fzf | sed 's/^([ \*]*origin\/[\ *]*)*//') git fetch
local selected_branch=$(git branch -r | fzf | sed -E 's/^([ \*]*origin\/[\ *]*)*//')
if [ -n "$selected_branch" ]; then if [ -n "$selected_branch" ]; then
git checkout "$selected_branch" git checkout "$selected_branch"