Skip to content

Commit 6e77d95

Browse files
authored
Merge pull request #853 from bethesque/feat/git-browse-with-multiple-remotes
feat(browse): select remote of current branch, fallback to origin
2 parents a0a32ab + 572ae0d commit 6e77d95

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

bin/git-browse

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@
22

33
if [[ $1 == "" ]]
44
then
5-
remote=$(git remote | head -n 1)
5+
branch=$(git rev-parse --abbrev-ref HEAD)
6+
remote=$(git config branch."${branch}".remote || echo "origin")
67
else
78
remote=$1
89
fi

0 commit comments

Comments
 (0)