Use GitHub for Version Management

Source: Internet
Author: User

During program development, the code is inevitably modified countless times. For beginners, version control is not very clear.

To put it simply, Version Control helps you save a version every time you modify the code. This is very important for team development. Here is an entry-level article on version control: getting started with Version Control (via cnbeta)

Git is a version control tool for Linux kernel development. Unlike common version control tools such as CVS and subversion, it uses a distributed version library instead of server-side software support (wingeddedevil Note: What server is used for this score, the use of HTTP or git protocols is not the same. And there is still interaction with the server when pushing and pull .), It makes it extremely convenient to publish and exchange source code. Git is fast, which is naturally important for large projects such as Linux kernel. Git's most outstanding is its merge tracing capability. (Via Baidu encyclopedia)

This article mainly introduces how to use git to synchronize with the code on the GitHub Website:

1. First, install the GIT tool on our computer.

Git tool official website: http ://Git-Scm.com (inaccessible within the wall)

Git tool on Windows: http://code.google.com/p/msysgit/

Download git

After the download is complete, open the file for installation.

2. Set ssh. GitHub can use SSH for transmission.

First open the terminal

Enter the command to open the SSH folder

Cd ~ /. SSH

Generate SSH public and private keys

Ssh-keygen-t rsa-c "email address"

Enter the private key and password.

Add an SSH Public Key to the GitHub website

In accout setting on GitHub, click Add SSH key

Use a text editor to open the id_rsa.pub file in the. Ssh folder, copy and paste it to GitHub, and then save

3. Create a project code repository on GitHub

4. Create a new initialization git on the local machine, right-click the project folder, and select init here

5. Add remote resources

SSH path for reading the project from GitHub

Add Remote resource

6. download code remotely

Synchronize code from GitHub to git Repository

Merge git repository code to a local project

7. Upload the code to GitHub

Add all files to git Version Control

Submit code to git Repository

Submit the GIT repository to GitHub

Now, the code is synchronized to GitHub.

Reprinted

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.