将Subgit git repo推送到远程GitHub repo / server

时间:2016-12-02 04:14:45

标签: git github subgit

我正试图将Subgit创建的git本地存储库推送到远程GitHub而没有太多运气。

我使用subgit

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

然后我在https://github.com/foobar/SparkDataSystem

处为推送创建了GitHub空回购
$ 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.

我也试过'subgit configure; subgit install'路由具有相同的结果。我显然错过了将这个本地git repo推送到GitHub上的远程仓库的步骤。有什么想法吗?

2 个答案:

答案 0 :(得分:0)

如果您需要将https://ghuser:ghpass@github.com/foobar/SparkDataSystem更改为https://ghuser:ghpass@github.com/foobar/SparkDataSystem.git

,请查看

答案 1 :(得分: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)