Using github: Tortoisegit and Msysgit configuration

Source: Internet
Author: User
Tags commit ssh git clone tortoisesvn
1. Installation of Tortoisegit and Msysgit

(1) tortoisegit Download: http://download.tortoisegit.org/tgit/, if tortoisegit English look not pleasing to the eye can be installed a Chinese language pack.

(2) msysgit download: http://msysgit.github.io/, or Msysgit github:https://github.com/msysgit/msysgit/releases/, with multiple historical versions Or Msysgit's Google code link: downloads-msysgit-git for windows-google Project Hosting, which is also available in several historical versions.

(3) All software is as follows:

2. Generate the key locally

(1) Locate Puttygen and run:

(2) Click "Generate" to generate the key (RSA encryption technology), where GitHub uses the default "SSH-2 RSA" method to generate the key. The build process is calculated based on the trajectory of the mouse run, and the key is generated to copy the public key (the contents of the box) to the Clipboard , and the public and private keys are saved for easy use.


3. Set SSH public key

Go to github.com first find accout settings, then add SSH key

Paste the public key you just copied in:


Click on Add key to get it done. The key is used when manipulating the code, which is understood.

4. Set Tortoisegit

First open the Tortoisegit settings:



Click Check now to display the current Git version number, and Git and tortoisegit have been embedded right-click:


5. Work with the code on GitHub

To demonstrate the operation, create a new GitHub code repository here:


(1) if it is a git clone operation

is to completely copy a repository from GitHub (including directories)

As an example of a newly created warehouse "testing", you now need to clone the code locally and choose Git clone directly from a local directory:

Then enter the git URL for the online repository and select the saved private key:

Click OK, clone complete:

The local directory appears in the warehouse we created online "testing":


(2) if it is a git pull operation

You need to create the local repository first, then set up Git's remote information, and finally pull the online code to the local repository in the local repository directory.

A. Create a local repository first: Find a local directory (don't take Chinese, create a new testing2 directory here) as the repository's local directory, select "Git Create repository Here", then click "OK" button, then "Proceed", This creates a hidden directory of ". Git" in the project file.


B. Set up Git's remote information: Right-click inside the directory and select settings. tortoisegit

Edit the information in Git's remote options: The URL is the repository git url,putty is the saved private key, the push URL is not available here for the first time can not be specified. Click Add New/save to confirm.

C. Finally pull all the online code to the local repository: Right-click inside the directory, select Tortoisegit


The following interface appears: If remote is blank to prove that git information is not set up, you need to go back to the previous step or click Manage Remotes to reset


Click Ok,pull to finish, the code is all local.


(3) submit code

The commit code includes GIT add,git commit and git push operations. Before committing the code, you need to clone or pull a repository (refer to the clone and pull operations above), here I create a new local repository directory "Testing3", and the previously newly created warehouse "testing" all pulling down as a demonstration.

A. Create a new helloworld.txt as a test file

B. Click File, right-Tortoisegit select Add


C.add operation OK, click File, right-select Git commit

Message must be filled in, author and time selected:

Click OK to submit to the local directory, and the last Git push action is required to actually commit to GitHub.

D. Right-click in the directory and select Push Tortoisegit

This time, because it is a push operation, you need to add a push URL to git's remote information:

This option allows remote to have the correct information after the push is selected:

Click OK and enter your username and password to upload to GitHub:

Finally, you'll see what's new on GitHub:


PS: If it is to upload subfolders, pull first, modify and then commit the final push can be. "Reference: Tortoisegit and Msysgit Installation and use notes (using upload data to GitHub under Windows)"


6. Other

summarize the steps: Install Tortoisegit and msysgit, create a key locally, set the public key on GitHub, and finally commit or download the code. There are several other ways to do this:

The first kind is tortoisesvn:http://tortoisesvn.net/downloads.html. Since git already supports SVN operations, you can do the following:


But it is equivalent to direct online operation, the response speed is very slow, it is very painful to use.

The second is the GitHub client: Http://git-scm.com/downloads (including the four editions of Windows,linux,mac Os,solaris)


The last is the GIT command line, familiar with the command line is very convenient, such as I am not accustomed to the command line rookie had to trouble point with the GUI.


Reference: Tortoisegit and Msysgit Installation and use notes (using upload data to GitHub under Windows)



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.