0

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.
Helbo
  • 473
  • 10
  • 32
  • Possible duplicate of [src refspec master does not match any when pushing commits in git](https://stackoverflow.com/questions/4181861/src-refspec-master-does-not-match-any-when-pushing-commits-in-git) – phd Jul 20 '18 at 08:31
  • @phd I've been through that one before I posted. I do not see how I could possible apply any of the suggestions in there to my issue. However I'm also fumbling in the blind here. – Helbo Jul 20 '18 at 08:42
  • 1
    You don't have a `master` branch. – torek Jul 20 '18 at 14:46

1 Answers1

2

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
Andy Li-MSFT
  • 28,712
  • 2
  • 33
  • 55
  • however as I understand if I pull from one git repository then my origin master is that repository ? meaning that my intention of push to another repository would not work with your suggestion as you look at it like a normal initial commit. I'm trying to sync up two git repositories not make a new project that I can push out to a repository – Helbo Sep 20 '18 at 07:29