Use git in SVN Mode

Source: Internet
Author: User
Download SVN => download msysgit and tortoisegit

Msysgit: http://msysgit.github.io/
Tortoisegit: https://code.google.com/p/tortoisegit/wiki/Download

Svn-checkout => Git-clone

SVN checkout directly uses the user name and password to obtain the project code, while git requires more things, such as the user name, email address, account similar to the GIT website, and SSH-key.

Get ssh-Key

Find tortoisegit-> puttygen under the Start Menu, click Generate, And the mouse keeps moving. After the creation, copy the text generated in the blank area that the mouse keeps moving, which is actually the public key. Then save the private key.

Then log on to the GIT website and add the ssh-key, and enter the title and Public Key respectively.

Get and set this SSH-KEY, You can checkout code, using the git-clone command,
Note that in the dialog boxLoad Putty KeySelect and select the private key file (XXX. PPK) that you saved locally)

Svn-Update-> Git-sync

Because git uses the local repository and remote repository to save code, you should pay more attention to code updates than SVN. Even if the project icon is green, it only indicates that the local working directory is consistent with the code of the local repository, but it may be inconsistent with the far-end repository.

Therefore, to update the local code to the latest version, check the local repository and remote repository.

First, check the local repository: Right-click the working directory folder-> tortoisegit-> check for modifications. The changes to the working directory and local repository are listed. You can perform operations on a specific modified file on the interface, such as revert.

Then, check the differences between the local repository and the remote Repository: Right-click the working directory folder-> git sync. In this case, a dialog box is displayed to list the differences between local and remote warehouses. Then, based on your needs, if you want to remotely and locally store the same, you can directly modifypushJust go up. If you want to perform the same operation locally and remotely, remove the modifications from the local repository.

PullYou can pull down some modified logs of the remote warehouse, and then perform corresponding operations on the local warehouse. For example, if the local repository has been restored to an earlier versionPullAfter the operation, you can obtain the previous modification records.

Svn-commit-> Git-commit & Git-push

Svn-commit: Submit the local working directory to the remote warehouse in one step, while git uses commit to the local warehouse and then pushes the local warehouse to the remote warehouse.

The premise is, remember to update before commit!

Use git in SVN Mode

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.