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.

Issue with Remote 'origin' already exists.

See original GitHub issue

User on forum reported that this issue. Talking to @ahmelsayed, it seemed to happen to others as well. It happened on and off. Our call did remove before adding. It was unlikely race condition in our codes given deployment lock. Looking at LibGit2Sharp did not reveal much clue.

I suggest to fix by checking if the remote exists and has the same refspec. If so, no need to remove and add remote (avoiding this code path in the first place). This should be the main scenario.

Remote 'origin' already exists.
   at LibGit2Sharp.Core.Ensure.HandleError(Int32 result)
   at LibGit2Sharp.Core.Proxy.git_remote_create_with_fetchspec(RepositorySafeHandle repo, String name, String url, String refspec)
   at LibGit2Sharp.RemoteCollection.Add(String name, String url, String fetchRefSpec)
   at Kudu.Core.SourceControl.Git.LibGit2SharpRepository.FetchWithoutConflict(String remoteUrl, String branchName)
   at Kudu.Services.ServiceHookHandlers.ServiceHookHandlerBase.Fetch(IRepository repository, DeploymentInfo deploymentInfo, String targetBranch, ILogger logger, ITracer tracer)
   at Kudu.Services.FetchHandler.<PerformDeployment>d__12.MoveNext()

Issue Analytics

  • State:open
  • Created 7 years ago
  • Comments:7 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
davidebbocommented, Jun 5, 2017

@skapatech looks like libgit2sharp issue is still active. Can you try setting a SCM_USE_LIBGIT2SHARP_REPOSITORY=0 app setting and check if that takes care of it?

0reactions
davidebbocommented, Aug 16, 2017

The linked libgit2sharp issue did not get traction unfortunately.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Remote Origin Already Exists Error: How To Fix It
Solving the "Remote Origin Already Exists" Error in Four Different Ways · 1. Remove the Existing Remote · 2. Update the Existing Remote's...
Read more >
How to fix 'fatal: remote origin already exists' Git error
fatal: remote origin already exists is caused by the cloned repository already having a URL configured. Specifically, a URL that leads to the...
Read more >
Remote origin already exists on 'git push' to a new repository
Remote origin already exists on 'git push' to a new repository · Give the output of the command $> git remote -v show...
Read more >
How to Fix Git Error "Fatal: remote origin already exists"
The error `fatal: remote origin already exists` is caused when you attempt to create a link to a remote repository called “origin” when...
Read more >
How to Deal with fatal: remote origin already exists Error
Another reason is trying to change the URL of the “origin” remote repository using the git remote add command. The remote add command...
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