paulirish/git-open

Branches named different locally than what is tracked as upstream

Closed this issue · 3 comments

When I have push.default set to upstream I think the upstream branch should be opened.

I can put together a PR if you want to offer some guidance in what you are looking for.

Sorry for the delay, I agree with you on this. If you're still interested in doing a PR - here's the relevant code:

git-open/git-open

Lines 45 to 50 in 5fefffe

branch_name=$(git name-rev --name-only HEAD 2>/dev/null)
tracked_remote=$(git config "branch.$branch_name.remote")
default_remote=$(git config open.default.remote)
remote=${1:-$default_remote}
remote=${remote:-$tracked_remote}
remote=${remote:-"origin"}

lovef commented

I believe this relates to the PR I opened: #140, though I disregard push.default and always default to upstream branch as that fits my use case.

@lovef fixed this in #140. If you continue to have an issue on master let us know