同时使用SVN和Git进行版本控制

由于个人习惯使用Git作为版本控制工具,但有时单位使用的是SVN。在偶然间发现Git也有SVN工具,于是试着融合了一下,发现是可行的。以下是命令:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# 克隆svn仓库
$ git svn clone https://192.168.x.xxx/xxx

# 添加忽略
$ touch .gitignore
$ cat ".svn" > .gitignore

# 首次提交本地git
$ git add .
$ git commit -m "init"

# 拉取svn避免冲突
$ git svn rebase

# 提交svn
$ git svn dcommit

# 提交远程git
$ git push