我想從SVN導入一些文件到一個新的git倉庫。只從svn倉庫導入特定的文件到git
例如,我已在在SVN如下:
files/file1
files/file2
files/file3
files/image1
files/image2
我只想導入files/image*
文件。
這可能嗎?
我想從SVN導入一些文件到一個新的git倉庫。只從svn倉庫導入特定的文件到git
例如,我已在在SVN如下:
files/file1
files/file2
files/file3
files/image1
files/image2
我只想導入files/image*
文件。
這可能嗎?
我從你的標籤中假設你正在使用git-svn?如果是這樣,請查看--ignore-paths
選項。在git svn init
或git svn clone
上使用它可以讓您在本地配置中保存的值通過,或者通過git svn fetch
進行忽略。
看看這個鏈接。 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://[email protected]/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
完成!
有沒有辦法做到--ignore-paths選項?我目前在git 1.5.5.6上,並沒有提供,但正在尋求升級。 – 2011-01-26 17:50:09