(1) create a project directory
Mkdir app
(2) initialize the project
CD app
Git init
(3) Modify description
CD. Git
VI description
(4) filter file types that do not need to be managed, including each specific file
CD info
Sudo VI exclude
(5) add all the files to be managed to the GIT Library
Return to the. Git directory.
Git add -- all
(6) Local submission
Git commit
(7) create and develop Branch
Git branch yin_ui_change
View Current branches
Git branch-
The execution result is as follows:
* Master
Yin_ui_change
* Indicates that the current branch is on the master.
(8) switch to the working directory
Git checkout yin_ui_change
Run git branch-A and the result is as follows:
Master
* Yin_ui_change
(9) after one branch is modified, commit is required.
Git commit-a-m "Your commit MSG"
Use gitk or gitk & to view all files currently submitted
If a new file is added, add all before commit.
Git add -- all
Git commit-a-m "something"
(10) Run branch merge to master
Git checkout master
Git merge yin_ui_change
(11) view diff
Use gitk + meld
Install meld: sudo apt-Get install meld
Select a previous version on the left-side modification history tree of gitk, right-click another historical version, and choose "Diff this-> selected" or "Diff selected-> This ", select the file to be compared in the patch/tree window on the right of gitk, right-click and select "extend diff", and then OK.
(12) view the current status
Git status