欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页

Using Git with Subversion

程序员文章站 2024-02-22 08:54:58
...

Checkout the SVN repository in standard layout (trunk/, branches/, tags/) using -s.

git svn clone -s https://192.168.117.216/repository/cooceo/cooceo-search
cd cooceo-search

Cleanup unnecessary files and optimize the local repository (recommended).

git gc --aggressive

Copy svn:ignore to git, so both repos ignore the same files.

  • as an own file you can track, but need to commit it to the SVN repo

    git svn show-ignore > .gitignore

  • ignore it in your local GIT repo

    git svn show-ignore >> .git/info/exclude

    git svn show-ignore > .gitignore echo '.gitignore' >> .git/info/exclude

Create a feature branch (so master is used for SVN commits)

git checkout -b new_branch_name [old_branch_name]

Use GIT as usual

git status git add . git rm $(git ls-files --deleted)
git commit -m git checkout git reset HEAD

Squash multiple GIT commits into one SVN commit

git checkout master
git merge --squash <feature_branch>

Update from the SVN repo

git svn rebase

Commit the changes from GIT to SVN repo

git svn dcommit

Repeat the last two commands as often as you like.

✱ ✱ ✱

 

from:http://blog.blindgaenger.net/using_git_with_subversion.html

转载于:https://www.cnblogs.com/joe-yang/archive/2012/04/29/2476174.html