Linux Learning-git Common commands

Source: Internet
Author: User
Tags version control system

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

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.