`--compare-branch` should default to `@{upstream}` and not `origin/master`
See original GitHub issueNot all branches are forked off a branch named master
in remote origin
. When an upstream has been configured for current branch it should be the first choice; when there is none origin/master
is still the obvious default.
Issue Analytics
- State:
- Created 3 years ago
- Comments:9 (7 by maintainers)
Top Results From Across the Web
What is the difference between origin and upstream on GitHub?
When a repo is cloned, it has a default remote called origin that points to your fork on GitHub, not the original repo...
Read more >Git alias trick: Comparing your local branch to the upstream ...
Hello! I would like to share a small Git alias that has made my life so much better: The ability to compare my...
Read more >Git - Remote Branches - Git SCM
While “master” is the default name for a starting branch when you run git init which is the only reason it's widely used,...
Read more >Git - Fix Error: The Current Branch Has No ... - Unfuddle Support
How to fix Git error: The current branch has no upstream branch. An upstream branch is a remote branch that is being tracked...
Read more >Git Upstream and Downstream - javatpoint
The git set-upstream allows you to set the default remote branch for your current local branch. By default, every pull command sets the...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I agree it’s frustrating. But I can’t simply change the default without breaking existing users workflows
And while githubs default is
main
gitlab and git itself still very much default tomaster
. I thinkmain
is a better name but it’s not relevant to this project.I’m the maintainer of this project. As such I try and provide timely feedback on prs. If I get a bug report with enough info to act on I reproduce it in a test and fix it. Whenever a fix or a feature comes in I release it asap.
But I typically don’t implement new functionality. Someone has to care enough to implement it themselves.
In this case I’ll take a look, probably this weekend. I might just resort to providing a more helpful error message or perhaps trying
main
ifmaster
does not exist. As far as I know there is not really a clean way of detecting the “main” branch.Additionally, the ecosystem is transitioning from
master
tomain
as the default branch name, soorigin/master
is no longer an obvious default. I’d recommend to infer the upstream branch. I’d even go as far as to say thatmain
should be the preferred fallback, but if any ofmain
,master
,default
, or possibly others are present, then they will be preferred (in that order) if no upstream is indicated.