The recent use of git has made it possible to realize the advantages of GIT in branch management and offline development, which can create different branches for different tasks in the local repository. When your repository is in SVN type, if you want to use Git locally for versioning, you can use GIT-SVN.
Install gitIf you do not have Git installed, you can download the installation from Http://git-scm.com/downloads. git installs with GIT-SVN (recommended to install the latest version).
git-svn Simple to use
1. Clone an SVN repository (equivalent to SVN checkout)Git svn clone http://svn.example.com/project/trunk
2. Enter into the new clone directoryCD Trunk
3, the current branch is master, you can use the GIT branch checksumGit branch
4. Make changes locally and submit to local git repositorygit add, git commit ...
5. Update SVN repository (equivalent to SVN update)Git svn rebase
6. Submit Changes to SVN repository (equivalent to SVN commit)Git svn dcommit
view GIT-SVN Help documentationTo learn more about the use of GIT-SVN, you can view the GIT-SVN Help documentation in the following ways:
- Git svn--help
- Git svn help
- git Help svn
- Git--help svn
Or you can view the Help documentation available on the website.
using SourcetreeSourcetree is a free Git and Hg client under Windows and OS x. It is verified that Sourcetree supports the cloning of SVN repositories into a git repository and other operations that can be performed using the GIT-SVN command line.
problems encountered
git svn can ' t authenticate on svn://repositoryWhen using git svn clone-s svn://git.oschina.net/donhui/md-doc-with-pic, the following error is reported:
Authorization Failed:cannot Negotiate authenticationMechanism AT/USR/LIB/PERL5/SITE_PERL/GIT/SVN.PM Line 310
The version of Git that you are using is: Git version 1.9.5.
Msysgit.1
Through aol.com Search, find the following page: http://comments.gmane.org/gmane.comp.version-control.msysgit/17865 page has the following fragment, so that this is a issue, SVN repositories using the HTTP (s) protocol are normal:This
issue exists on several versions of Msysgit,Including latest 1.8.0-preview20121022 and 1.8.1-preview20130110.
Cygwin ' s version of Git can fetch from this.
Reference: http://git-scm.com/docs/git-svn/1.8.5 http://blog.chinaunix.net/uid-11639156-id-3077471.html/http Www.oschina.net/translate/howto_use_git_with_svn
Using Git on the SVN repository