git-svn Tips
by
Galoisplusplus
- 五 25 7月 2014
- 用
gitclone远端svn仓库(repo):
1 | |
- 用
git-svn从远端svn仓库拉取提交(commit)到本地:
1 | |
- 用
git-svn把本地推送到远端svn仓库:
1 | |
- 用
git-svncheckout远端svn仓库的另一条svn支线(branch)到本地git支线:
假设我们要checkout的支线叫"another-branch",首先在.git/config添加:
1 2 3 | |
然后在命令行里执行:
1 2 | |
- 使用
git-svn来获取svn仓库的所有svn支线的改动:
1 | |
- 用
git-svn某条svn支线复制提交到另一条svn支线:
我一开始想复杂了,写了下面的脚本,先在原来的支线上生成某一提交的patch,然后到另一支线打上该patch:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 | |
后来发现git-svncheckout的svn支线其实和git支线没什么两样,用git cherry-pick就可以了。
- 将远端svn仓库的忽略文件列表加到git设置:
1 | |
References
Add an SVN remote to your Git repo
Add svn repo to existing git repo?
Checkout remote branch using git svn
Selective import of SVN branches into a git/git-svn repository