我正在尝试将一些文件从SVN导入到新的git存储库。
例如,我在SVN中有以下内容:
files/file1
files/file2
files/file3
files/image1
files/image2
我只想导入files/image*
个文件。
这可能吗?
答案 0 :(得分:1)
我从你的标签中假设你正在使用git-svn?如果是,请查看--ignore-paths
选项。在git svn init
或git svn clone
上使用它可以将您传递的值保留在本地配置中,或者在git svn fetch
上保留,以便忽略每次获取。
答案 1 :(得分:0)
查看此链接。 http://ivanz.com/2009/01/15/selective-import-of-svn-branches-into-a-gitgit-svn-repository/希望这会有所帮助!
在.git / config中定义新分支:
[svn-remote "release-branch"]
url = svn+ssh://xxxx@mono-cvs.ximian.com/source/branches/mono-2-2/mcs
fetch = :refs/remotes/git-svn-release-branch
导入SVN分支。 SVN_BRANCHED_REVISION是分支发生在SVN时的修订版。
[~]$ git svn fetch release-branch -r SVN_BRANCHED_REVISION
将本地Git分支连接到远程分支:
[~]$ git branch --track release git-svn-release-branch
结帐并更新
[~]$ git checkout release
[~]$ git svn rebase
完成!