1.克隆 git svn clone svn://192.168.1.236/test(如果有其它需要,可以增加clone参数)
2.git同步svn: git svn rebase
3.gitlab远程:git remote add origin git@192.168.1.237:root/bmh.git
4.上传:git push -u origin master
5.有svn更新就继续git svn rebase,git push
6.cat /home/script/svn-git.py
#!/usr/bin/env python # -*- coding: utf-8 -*- import os,time print time.ctime() dirname = os.getcwd() home = r'/home/bmh' if dirname is home: os.system('git svn rebase') os.system('git push') else: os.chdir(home) os.system('git svn rebase') os.system('git push')
7.crontab -l
* */3 * * * /usr/bin/python /home/script/svn-git.py >> /var/log/svn-git.log