The linux system installs the git and git common commands

  • 2020-05-07 20:48:47
  • OfStack

1 installation 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 required. The second command is also the Git package, but it is distributed separately and can be installed optionally.

Download the GIT library for the remote project locally
[code]
$  git clone git:// remote Git library address   filename
[code]

filename is your local folder name to clone the remote library to this folder

3 common commands

(1) git branch view the local branch

(2) git branch-a     view remote branches

(3) git checkout   branchname           switch branches

(4) git addyourfile  

(5) git commit-a-m "description"       submit your current development to the staging area, which can be understood as your local GIT library

(6) update git pull  . If several people are developing on one branch at the same time, it may lead to out-of-sync, causing your local GIT library to lag behind or remote GIT library ahead of time. This is the time to update your local git library.

(7) git push submit, submit the code developed by yourself to the corresponding remote points

(8) git status   looks at the state of the workspace and what has been done on this branch

(9) git log is useful for viewing the operation log

(10) git merge merges branches. The self-developed modules will eventually be merged into the general branch of the project, which is to switch to the general branch of the project first, and then git merge's own branch

(11) git branch-d /D     yourbranch   delete the local branch

(12) git push origin :yourbranch       delete the remote branch          


Related articles: