Skip to content

Commit

Permalink
feat(browse): automatically select origin remote if one exists, fallb…
Browse files Browse the repository at this point in the history
…ack to first otherwise
  • Loading branch information
bethesque committed Jul 25, 2020
1 parent 2076ac9 commit 572ae0d
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bin/git-browse
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@

if [[ $1 == "" ]]
then
remote=$(git remote | head -n 1)
branch=$(git rev-parse --abbrev-ref HEAD)
remote=$(git config branch."${branch}".remote || echo "origin")
else
remote=$1
fi
Expand Down

0 comments on commit 572ae0d

Please sign in to comment.