Helbo
Helbo

Reputation: 505

git error: failed to push some refs refspec master does not match any

I am lost here I don't know much if anything about git have been following a tutorial online and the result is this error message. when I do a push. I've been looking through the other posts but I do not seem to be able to apply their solutions.
I think it should be noted that I already have cloned the repository and are now trying to set up a automated sync between the two repositories.

this is the tutorial I've been following https://blogs.microsoft.co.il/leonj/2017/01/24/synchronizing-tfs-2015-and-vsts-with-github/#GITHUB_TFS with the difference being that my TFS server is a 2017 and that the git is a bitbucket git repository I'm trying to sync with.

First I pull from

git pull https://$(bitbucketcredentials)@bitbucket.org/path/to/git.git master

then I try to push to with the following response from my tfs:

 git push http://tfsserver:8181/tfs/aCollection/_git/repo/_git/TFSTeamsMigratorTool master:master
    2018-07-20T07:27:58.2617421Z error: src refspec master does not match any.
    2018-07-20T07:27:58.2617421Z error: failed to push some refs to 'http://tfsserver:8181/tfs/aCollection/_git/repo/_git/TFSTeamsMigratorTool'
    2018-07-20T07:27:58.3400564Z ##[error]Process completed with exit code 1.

Upvotes: 0

Views: 2176

Answers (1)

Andy Li-MSFT
Andy Li-MSFT

Reputation: 30412

Just try using git push origin master instead of the third command git push <TFSRepoUrl> master:master.

If that still not work, then try to add command line tasks to run below command after the second task:

git add -A

git commit -m "initial commit"

git push origin master

Upvotes: 2

Related Questions