1.github Introduction
Git is a distributed version control system that was originally written by Linus Torvalds and used as the management of Linux kernel code. Since its launch, Git has also been a big success in other projects, especially in the Ruby community. Git is currently used in many well-known projects, including Rubinius, Merb and Bitcoin. Git can also be used by deployment tools such as Capistrano and Vlad the Deployer.
GitHub site: www.github.com
2. Common commands
git remote add upstream https://github.com/... // 新建分支用于存repository
Clone to local command
git clone https://github.com/*//clone to localgit fetch BRANCH2//Update informationgit merge Branch2/master//merge Local Informationgit add. //Add new files or change new filesgit remove** //delete filesGit commit- M ' by whom do ' //Submit files to localgit push//push to the serverGit pull Origin Master//Pull information from the serverGit remote//View all branches on the repositoryGit branch -A //View all branchesGit branch- R //View Remote branchGit branch- D *** //Delete branchGit branch*** //New branchGit checkout*** //Toggle Branchgit status//View statusGitLog //View commit modification recordgit remote show origin//View related information
Submit and update files
-u origin master //将commit的代码,push到github上git pull //将github的代码,pull到本地
3. Copy Id_rsa.pub to GitHub
(1) Create SSH key
$ ssh-keygen-t rsa ///生成的SSH key文件保存在中~/.ssh/id_rsa.pub
(2) Add SSH key to GitHub
Copy the contents of the. ssh/id_rsa.pub file
To open the Add SSH key interface in GitHub account management, follow these steps:
- Sign in to GitHub
- In the top right, click the Accounting settings icon
- Select SSH Key
- Click Add SSH Key
Copyright NOTICE: This article for Bo Master original article, without Bo Master permission not reproduced.
Linux Learning-git Common commands