git push to SVN use step detailed

Source: Internet
Author: User
Tags auth commit svn


First, configure SVN save plaintext password

This way, when you push with git, you don't have to ask for the password every time.

With recent versions of Subversion (~ 1.8) can configure password caching via $HOME/.subversion/servers:


[Global]
Store-passwords = yes
Store-plaintext-passwords = yes
But depending on your system this may is not enough. If It isn't, make sure that $HOME/.subversion/config contains:


[Auth]
Password-stores =
Which means that variable password-stores are explicitly set to the empty string (background was that SVN now contains s Upport for some key-agent tools-and the interfacing to the default configured ones of May is fragile-resulting in silent Ignoring of the above options and non-caching behaviour).
When using SVN for the "the" Hierachy $HOME/.subversion is created after the "the" the "the" and "the" the "the" NG the checkout. Subversion creates then the mentioned files and fills them with the most important out, options-commented including Documentation.
Thus, it also makes sense to move an old $HOME/.subversion directory away to have a well-defined starting point.
Another pitfall are permissions-i.e. Files which are not readable under $HOME/.subversion-but this should not often The problem, because when SVN creates them, it takes care the right permissions (e.g. the Auth directory are only Reada ble by the user then, not by the Group/all, independent of the configured Umask).


Look, after modifying the configuration, the saved password is plaintext, such as:


┌─[sh4d0walker@huangye]-[~/.subversion/auth/svn.simple]-[Wed June 09, 02:46]
└─[$] <> Cat 1902B28055F9B44A3128BEF8BFCAF4FC
K 8
Passtype
V 6
Simple
K 8
Password
V 8
pw123456
K 15
Svn:realmstring
V 31
<svn://172.16.7.253:81> prj2014
K 8
Username
V 6
ABCdef
End

As you can see, here is the warehouse address, username (abcdef) and plaintext password (pw123456)
The number after K and V represents the character length of the value.

Two, Git starts pulling code from the SVN warehouse

Git svn clone-s svn://172.16.7.253:81/prj2014/myprj/

Pay attention to the back/must not forget, otherwise can not clone. That's the way SVN is, put up with it.
The-s is there to signify this my Subversion repository has a standard layout (trunk/, branches/, and tags/.) If your repository doesn ' t have a standard layout, you can leave this off.
The-s parameter indicates that the SVN standard naming method is used, that is, trunk,tags,branches, this parameter is sometimes very important, recommended to use, the command can also add a folder name after the clone directory

Git svn fetch

You may encounter a fetch only if you want to start from a version, then you need the –r parameter. For example:

$ git svn fetch-r 1342:head

Commit after modifying code locally
This is no use for SVN, not to mention.
Synchronizing a remote SVN server

Git svn rebase

My personal understanding is that this is the SVN up command in SVN.

Before committing back to Subversion, you'll want to update to apply any new changes in the repository to your local Git Repo.
This would download all new changesets from subversion, apply them to the last checkout from subversion, and then re-apply Your local changes on "top".
Push to remote SVN server

When you ' re ready to commit to Subversion, execute:


Git svn dcommit

Daily modification and submission
Exactly the same as Git's workflow
In order to facilitate the merger, reduce unnecessary trouble, it is best to keep Master branch master unchanged, in a new branch of daily work
Cut back to master get the latest code from SVN


$ git checkout master
$ git rebase
Master sync, merge with Work branch
&NBSP
$ git checkout work
$ git reba Se master     # # Manual resolution of possible conflicts
Finally, GIT-SVN initialization, this should be used less.
 
git svn init svnremoteurl

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.