Linux git tutorial

Source: Internet
Author: User

1. Install GIT

$ Sudo aptitude install git

$ Sudo aptitude install git-doc git-svn git-email git-gui gitk

The git package contains most of the Git commands, which are mandatory and the second line is also the Git package, but is released separately. You can choose to install it.

2. Download the GIT library of the remote project to the local device.

$ Git clone git: // remote Git repository address filename

Filename is the name of your local folder to clone the remote library to this folder. This file is created by yourself.

3 Common commands

(1) view local branches in git branch

(2) view the remote branch in git branch-

(3) git checkout branchname switch Branch

(4) git add yourfile

(5) git commit-a-m "Description" Submit your current development to the temporary storage area, which can be understood as your local GIT Library

(6) git pull update. If several people develop on one branch at the same time, it may cause non-synchronization, resulting in local GIT library lagging behind or remote GIT library in advance, update your local database.

(7) commit by git push and submit the code developed by myself to the corresponding remote points

(8) view the workspace status in git status and the operations performed on this branch.

(9) It is quite useful to view operation logs through git logs.

(10) When git merge merges branches, the self-developed modules are eventually merged into the total branch of the project. This is to switch to the total branch of the project first, and then git merge's own branch.

(11) git branch-d/D yourbranch Delete local branch

(12) git push origin: yourbranch Delete remote Branch

I will share it here today, and I will add it later. I am also learning about it.

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.