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.

Local branch name conflicts with remote branch name

See original GitHub issue

Ok so i was trying to push files into my repo

and i came across this thing

Error Click Here

So i tried to pull, but when i tried that

I saw this

Can anyone help me? Please?

Can’t do pull request either, same error for some reason…

Thanks niik, i made new branch oof and made it default, then deleted master branch and now it works.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

4reactions
niikcommented, Jul 11, 2018

I believe what has happened is that a branch with the same name as your local branch was either created on, or already existed on the server/remote when you created your local branch. That branch on the remote had diverged from your local branch such that a fast-forward push was impossible.

Steps to reproduce

  1. Clone an existing repository
  2. Create a local branch test and create one dummy commit
  3. Before pushing/publishing, create a branch on the server called test and create one dummy commit
  4. Try publishing your local branch.

Alternative steps to reproduce

  1. Clone an existing repository
  2. Find an existing branch on the remote that has diverged from master
  3. Create a new branch locally with the same name as the remote branch
  4. Attempt to publish that branch.

We should certainly be doing a better job of handling this scenario and describing what’s going on but the easiest way forward for you right now would be to rename your local branch by going to the Branch menu and clicking on Rename... and then publishing your new branch.

@desktop/core I think that, at a minimum we should alert users if they’re creating a branch with a name that conflicts with an already existing branch on the remote. More long term we should probably have messaging that’s closer to 'There’s already a branch on the remote named foo. ’ rather than the generic messaging we have now.

2reactions
outofambitcommented, Sep 10, 2018

@Daniel-McCarthy thank you! i think something closer to the first approach would be fine, so long as it can handle a “default” remote who’s name isn’t origin

Read more comments on GitHub >

github_iconTop Results From Across the Web

What to do with remote branch that has Conflict in the name?
Remote branch names are normally managed on the remote. That is, you can do this: git branch -r -d "b1 - Conflict On...
Read more >
Manage Branches and Resolve Conflicts in Git - Cloudways
Learn how you can manage Git branches and resolve conflicts in this ... Once done, pass the branch name with git command to...
Read more >
Creating and Merging Conflicts on Git Branches - GitHub Pages
Create a new git branch called planets-before-merge-conflict by running ... When you push a branch to a remote git repo, you can give...
Read more >
Git in Visual Studio is not correctly handling branches with ...
When multiple branches on remote Git server have same name but different cases (e.g. features and Features), VS cannot recognize it correctly and...
Read more >
Git: Guide to Solving Merge Conflicts - Stack Abuse
Merge Conflicts arise when multiple agents modify the same part of a file and push their changes to a remote branch. When you...
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