将svn迁移到git的子目录 [英] migrate svn to subdirectory of git

查看:140
本文介绍了将svn迁移到git的子目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想用git替换我的svn仓库。不幸的是,我无法一蹴而就,简而言之,我需要将一个带历史记录的svn仓库移动到一个预先存在的git仓库的子目录中。所以我现在有:

 
svn:
svn1 /
svn2 /

git :
git1 /
.git /
gita /

我想:

 
svn:
svn1 /

git:
git1 /
.git /
gita /
svn2 /

任何想法都可以做到这一点?

$ b $您可以用git-svn克隆svn repo以保存历史记录,然后将其与git repo合并。
$ b
$ b

例如:

  git svn clone path_to_svn_repo 

这将创建一个新的svn repo的git克隆。
现在用你的git仓库转到目录,并将刚刚克隆的仓库合并为一个正常的仓库仓库:

  cd git-repo 
git pull path_to_converted_git_repo


I'd like to replace my svn repository with git. Unfortunately I can't do this in one shot and to cut a long story short, I need to move an svn repository, with history, into a subdirectory of a pre-existing git repository. So I currently have:

svn:
svn1/
svn2/

git:
git1/
  .git/
  gita/

And I want:

svn:
svn1/

git:
git1/
  .git/
  gita/
  svn2/

Any ideas on the best way to do this?

解决方案

You can clone the svn repo with git-svn to preserve history and then merge it with the git repo.

For example:

git svn clone path_to_svn_repo

This will create a new git clone of the svn repo. Now go to the directory with your git repo and merge the just-cloned as a normal git repo:

cd git-repo
git pull path_to_converted_git_repo

这篇关于将svn迁移到git的子目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆