Installation and use of git in a Windows environment

Source: Internet
Author: User
Tags git client

Last night, I used 1.5 hours of GitHub, in order to make it easy for others to install and use, and to review their own painful process, specifically write this blog. OK, let's get started ....

My environment: win10,msysgit1.9.4.0

One, git environment deployment.

1. Apply for a GitHub account on GitHub. Address: https://github.com/.

2. Install the GIT client. I am installing msysgit, I am downloading the download bar. : http://www.xiazaiba.com/html/25984.html. The installation process can refer to: http://jingyan.baidu.com/article/90895e0fb3495f64ed6b0b50.html.

3. After the installation is successful, open git bash.

A. Enter "git config--global user.name user name", "git config--global user.email mailbox" To set the username and mailbox.

B. Create a public key publickey. Enter the command "SSH-KEYGEN-C" XXX "-t RSA".

C. Locate the folder where the key is located, open the Id_rsa.pub file, copy all the contents, click "Personal Settings" in GitHub to go to the Settings screen, select "SSH Keys", then click "Add another Public key". Paste the key contents you just copied into the corresponding box.

D. Validation. Enter "ssh-t [email protected]".

Second, upload the project.

1. Create a warehouse on GitHub. Name is HELLOWRD.

Now refresh the project page under GitHub, as shown below:

2. Create a local warehouse. The following creates a Helloword project locally and pushes it to GitHub. Create a directory structure for D:\GitProject\HellowWord.

3. The same CD command goes into the HelloWorld directory you just created, and then uses GIT init to initialize the current directory, which generates a. git hidden directory.

The Helloword folder is the local repository.

4. Copy the file you want to upload to the Helloword folder, such as Readme.txt.

5. Enter "git add Readme.txt".

6.commit. Enter "git commit-m" comment ""

7. Add the destination repository you want to upload, which is the warehouse on GitHub. "Git remote add origin [email protected]: User name/repository name. Git".

8.push. Push local code to GitHub. " Git push Origin master ". (Note: This process may fail due to network reasons, try a few more times)

9. Now refresh the project page under GitHub, as shown below:

Installation and use of git in a Windows environment

Related Article

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.