question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

`--compare-branch` should default to `@{upstream}` and not `origin/master`

See original GitHub issue

Not 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:closed
  • Created 3 years ago
  • Comments:9 (7 by maintainers)

github_iconTop GitHub Comments

3reactions
Bachmann1234commented, Jun 29, 2021

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 to master. I think main 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 if master does not exist. As far as I know there is not really a clean way of detecting the “main” branch.

2reactions
jaracocommented, Dec 13, 2020

Additionally, the ecosystem is transitioning from master to main as the default branch name, so origin/master is no longer an obvious default. I’d recommend to infer the upstream branch. I’d even go as far as to say that main should be the preferred fallback, but if any of main, master, default, or possibly others are present, then they will be preferred (in that order) if no upstream is indicated.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found