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.