2

我正在尝试将 Subgit 创建的 git 本地存储库推送到远程 GitHub,但运气不佳。

我使用 subgit 创建仓库

$ 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 上的远程 repo 的步骤。有任何想法吗?

4

2 回答 2

0

从您当前的分支中,尝试创建一个主分支并首先推送它。然后推动其余部分。

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

另外,确保 GitHub 存储库创建为(不README.md,没有文件)

于 2016-12-02T05:22:43.467 回答
0

看看是否需要更改https://ghuser:ghpass@github.com/foobar/SparkDataSystemhttps://ghuser:ghpass@github.com/foobar/SparkDataSystem.git

于 2016-12-02T04:24:03.613 回答