update git checkout remote shortcut function
This commit is contained in:
parent
42ebd7a7c0
commit
b317cbe0e0
1 changed files with 2 additions and 1 deletions
|
|
@ -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"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue