SVN migration to git follow-up push

Source: Internet
Author: User
Tags commit svn git clone

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










Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.