Git VCS yields " remote origin already exists

[10:36:11]Updating sources: agent side checkout

[10:36:11][Updating sources] Failed to perform checkout on agent: 'c:\git\bin\git.exe remote add origin' command failed. stderr: fatal: remote origin already exists.

I am running TeamCity 8.0.3 on Windows

I am using the Portablegit client from GitHub For Windows

If I look in buildagent temp directory I see what appears to be a bare clone in a .git folder.

If I try and run that command in that folder I get the same error.  I just can't understand why it is trying to do the remote add.

This is blocking us moving our TeamCity builds onto GitHub at this point.

Any tips appreciated.


1 comment
Comment actions Permalink

Figured out this issue.

There is a default origin in the GitHub for Windows portable git gitconfig.  


[remote "origin"]
 fetch = +refs/heads/*:refs/remotes/origin/*
 fetch = +refs/pull/*/head:refs/remotes/origin/pr/*

and it starts working.

No on to a new problem.

Please sign in to leave a comment.