SVN到GIT迁移给出错误,因为没有共同点

时间:2018-04-02 17:11:42

标签: git svn version-control gitlab git-svn

我正在尝试根据此网址中提供的步骤将我的项目从svn迁移到git:https://docs.microsoft.com/en-us/vsts/articles/perform-migration-from-svn-to-git?view=vsts#push-repository-to-a-bare-git-repository

但是在将存储库推送到裸git存储库时,我收到了以下错误:

C:\Git_Workspace\git_Repo>git push bare
No refs in common and none specified; doing nothing.
Perhaps you should specify a branch such as 'master'.
fatal: The remote end hung up unexpectedly
error: failed to push some refs to '../new_bare_repo.git'

我在这里发现了一个类似的问题svn to git conversion no refs in common解决方案没有帮助,但有一条评论建议添加大师像:

git push bare master

但它并没有仅仅在创建主文件的情况下以裸仓形式推送我的项目。

任何帮助指导我在这里发生的事情都非常感谢..

2 个答案:

答案 0 :(得分:3)

除非您想将本地裸仓库视为远程git服务器,否则通常不必将本地git仓库推送到本地裸仓库。

如果你想将远程仓库托管到第三方(比如github,bitbucket VSTS git repo等),你可以直接推送到远程仓库:

# After migrate svn repo to local git repo by git svn clone command
cd reponame
git remote add origin <remote repo URL>
git push origin --all

答案 1 :(得分:0)

有更好的方法将svn repo转换为git。 仅举几例,请参阅以下文档:

官方:https://git-scm.com/book/en/v2/Git-and-Other-Systems-Migrating-to-Git 位桶:https://www.atlassian.com/git/tutorials/migrating-overview

所有这些都是指相同的过程,但我发现这些文档编写得非常好。

相关问题