2

I'm trying to push a Subgit created git local repository to remote GitHub without much luck.

I create the repo using subgit

$ subgit import --authors-file ./authors.txt --username svnuser --password svnpass https://foobar.com:8443/svn/StatDNA/git_migration/SparkDataSystem SparkDataSystem.git
IMPORT SUCCESSFUL

I then create the GitHub empty repo for the push at https://github.com/foobar/SparkDataSystem

$ cd SparkDataSystem.git
$ git remote add origin https://ghuser:ghpass@github.com/foobar/SparkDataSystem
$ git push origin --all --follow-tags
No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
Everything up-to-date
$ git push origin master
error: src refspec master does not match any.
error: failed to push some refs
$ git push --set-upstream origin master
error: src refspec master does not match any.

I've also tried 'subgit configure; subgit install' route with the same results. I'm clearly missing a step to get this local git repo pushed to a remote repo on GitHub. Any ideas?

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250
adamjk
  • 101
  • 1
  • 5
  • Does https://foobar.com:8443/svn/StatDNA/git_migration/SparkDataSystem have trunk/branches/tags structure? If not the repository might be empty after translation. In this case "subgit configure --layout directory ..." + "subgit install ..." could help instead of "subgit import". – Dmitry Pavlenko Dec 02 '16 at 05:50
  • 1
    @DmitryPavlenko Thank you, that was exactly it. It's a basic directory with subprojects so using the configure with layout directory then install worked great. – adamjk Dec 02 '16 at 20:02

2 Answers2

0

Take a look if you need to change https://ghuser:ghpass@github.com/foobar/SparkDataSystem to https://ghuser:ghpass@github.com/foobar/SparkDataSystem.git

Sajib Khan
  • 22,878
  • 9
  • 63
  • 73
  • No luck, I tried with the .git extension and without. – adamjk Dec 02 '16 at 04:30
  • ok. `"error: src refspec master does not match any"`, make sure `master` branch exist in remote repo. `git branch -r` shows the remote branch lists. – Sajib Khan Dec 02 '16 at 04:34
0

From your current branch, try and create a master branch and push it first. Then push the rest.

git checkout -b master
git push -u origin master
git push origin --all --follow-tags

Also, make sure the GitHub repo is created empty (no README.md, no files)

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250