简体   繁体   English

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

[英]Pushing Subgit git repo to remote GitHub repo/server

I'm trying to push a Subgit created git local repository to remote GitHub without much luck. 我试图将Subgit创建的git本地存储库推送到远程GitHub,但运气不佳。

I create the repo using subgit 我使用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 然后,我在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.

I've also tried 'subgit configure; 我也尝试过'subgit configure; subgit install' route with the same results. subgit install'路由具有相同的结果。 I'm clearly missing a step to get this local git repo pushed to a remote repo on GitHub. 我显然缺少将本地git存储库推送到GitHub上的远程存储库的步骤。 Any ideas? 有任何想法吗?

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

From your current branch, try and create a master branch and push it first. 在您当前的分支中,尝试创建一个master分支,然后将其首先推送。 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) 另外,确保将GitHub存储库创建为 (没有README.md ,没有文件)

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM