SVN moved to Git
git svn init xxx
Git svn fetch
Or
git svn clone xxx
Associate to a remote server, if it already exists, the following two select 1
Git remote RM origin //delete Origin
git Remote add origin xxx.git //re-add Origin
Git remote to view all remote
git remote Set-url origin xxx.git
Push to remote
Git push-u Origin master //First push when
git push origin master //First push, directly use this command to push changes
After the move, consider that some time SVN will continue to update, then how to synchronize it.
Open the. git/config file first to see:
[Svn-remote "SVN"]
url = https://xxxx
fetch =: REFS/REMOTES/GIT-SVN
If not, you can click on the above to add a bit, the same is valid
That is, REMOTES/GIT-SVN is the git clone migration time SVN repository.
$ git show-ref
ec1aab5d3a45537898a5851c843d90036aadd62e refs/heads/master
58e66ad715e9f104d2455e5aeeb9b6dd415973f9 refs/remotes/git-svn
8b6bf396ba7567dc777f30bc7769ce804f96aa4f refs/ Remotes/master
ec1aab5d3a45537898a5851c843d90036aadd62e Refs/remotes/origin/master
1. Take the remote branch and differentiate a new branch local-git-svn then synchronize the SVN commit record,
$ git checkout-b local-git-svn remotes/git-svn
switched to a new branch ' LOCAL-GIT-SVN '
2. Then sync the SVN latest commit record
Git svn fetch
3. Switch back to the master branch and perform the merge
git checkout master
git merge local-git-svn
4. Push to the remote master
Git push Origin Master
5. Finally, the LOCAL-GIT-SVN branch can be deleted
Git branch-d local-git-svn
= = = "The front is a bit complicated and can be simplified to three steps:
Git svn fetch
git merge Remotes/git-svn
Git push Origin Master