Skip to content

Instantly share code, notes, and snippets.

@shijinkui
Created July 20, 2012 09:32
Show Gist options
  • Save shijinkui/3149875 to your computer and use it in GitHub Desktop.
Save shijinkui/3149875 to your computer and use it in GitHub Desktop.
git-svn 使用
http://www.ruilog.com/blog/view/5267.html
团队用git 管理代码,公司则用svn, 需要定期将代码同步到svn归档
1. 安装 git svn 插件
apt-get install git-svn
2. 建立本地 git-svn 库
本地代码目录为 /opt/src/search-git
为 git-svn 建立新目录 /opt/src/search-svn
cd /opt/src/
git svn clone -s http://192.168.48.100/svn/resource/search search-svn
cd /opt/src/search-svn/
3. 同步 git master 到 svn trunk
git pull /opt/src/search-git
git svn dcommit
4. 同步 git branch 到 svn branch
git branch v2.1 remotes/v2.1 (其中 remotes/v2.1 为 svn 分支)
git checkout v2.1
git pull /opt/src/search-git v2.1
git svn dcommit
--EOF--
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment