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