Skip to content

Commit

Permalink
Fix floatplane#29 - log better info when a branch's tracking info isn…
Browse files Browse the repository at this point in the history
…'t set.
  • Loading branch information
floatplane committed Dec 10, 2015
1 parent 0debb9c commit 0430fe7
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion bin/git-pr
Original file line number Diff line number Diff line change
Expand Up @@ -301,7 +301,22 @@ when "open"
remote = git.find_remote_for_local_branch source
remote_url = remote ? remote.url : nil
unless remote_url and remote_url.match /github\.com/
puts "Branch '#{source}' has never been pushed to GitHub."
puts <<EOS
Branch '#{source}' has never been pushed to GitHub,
or was pushed without setting the upstream branch.
To fix this problem, try running:
git branch --set-upstream-to=<your_remote>/#{source} #{source}
In the future, you can avoid this problem by making your first push
with the --set-upstream argument(or the shorthand, -u):
git push --set-upstream <your_remote> #{source}
git push -u <your_remote> #{source}
EOS
exit -1
end
github_source_owner = remote_url.match(/[email protected]:(.*)\//)[1]
Expand Down

0 comments on commit 0430fe7

Please sign in to comment.