Linux system install git and git common commands _linux

Source: Internet
Author: User
Tags git clone git commands

1 Installing Git

Copy Code code as follows:

$ sudo aptitude install git
$ sudo aptitude install Git-doc git-svn git-email Git-gui

The GIT package contains most of the Git commands, is a mandatory package, and the second line is a git package, but it is published separately and optionally installed.

2 Download the remote Project git library to the local
[Code]
$ git clone git://remote git library address filename
[Code]

FileName is your local folder name. Clones the remote library to this folder, which was created by yourself

3 Common commands

(1) Git branch view local branch

(2) Git branch-a View Remote branch

(3) Git checkout branchname Switch branch

(4) Git add yourfile

(5) Git commit-a-M "description" submits your current development to registers, which can be understood as your local git library

(6) Git pull update, if several people at the same time on the development of a branch, may cause a different step, causing their own local git library behind or remote Git library, it is necessary to update their own local library.

(7) Git push commits, submits the code which oneself develops to the corresponding remote cent to go up

(8) Git Status View the workspace status and see what's done on this branch

(9) Git log to see the operation logs, or very useful

(Ten) Git merge merged branch, the module that oneself develops finally wants to merge to the total branch of the project, this is to switch first to the project general branches, then git merges own branch

(one) git branch-d/d yourbranch Delete local branch

(in) Git push origin:yourbranch Remove remote branch

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.