gitgithubcvscvs2svncvs2git

cvs2git covert cvs to git and push multiple branches gets: error: src refspec master does not match any


I use cvs2git to convert a cvs repo to git. This project/repo has multiple branches and tags. Anyway I was able to (didn't get any error msg) convert this cvs repo to git. But when I push the git project to github I am getting this error. I think it might be I am push it to Master, but I have multiple branches. If that's the case, how can I push multiple branches to github? Thanks!

Here are the commands I ran:

git remote add origin https://github.com/mygithub/MyProject.git
git push -u origin master

Complete Error:
error: src refspec master does not match any.
error: failed to push some refs to 'https://github.com/mygithub/MyProject.git'.

Solution

  • Do you have a branch named master in your local repository? git branch will show you your local branches.

    It might be that you want to do git push --mirror

    --mirror Instead of naming each ref to push, specifies that all refs under refs/ (which includes but is not limited to refs/heads/, refs/remotes/, and refs/tags/) be mirrored to the remote repository. Newly created local refs will be pushed to the remote end, locally updated refs will be force updated on the remote end, and deleted refs will be removed from the remote end. This is the default if the configuration option remote..mirror is set.