The general process of Git is
1 Cloning a GIT repository development project
git clone <git url>
2 in this directory to create a file, after creating a file to add commit common operations
git add <youfile>git Add.
Git commit-m "prompt tag information"
3 to view the status
Git statusgit log-p-2 # See the Diffgit of the last two detailed edits remote-v
4 discovery not to be revoked
git checkout <your file>git checkout.
git reset <youfile>git reset.
5 If there is a branch
View branch Information
Git branchgit branch-v
New Branch
Git branch <new branch>
Delete Branch
git branch-d <you branch>
Force Delete
git branch-d <you branch>
6 Commit to Remote
Git push Origin Master
7 Common Tools
Git mergetool
Compare file differences between workspaces and the stage area
Git diff
Clone a branch to local, there will be a git project directory locally
git clone <git url>
Gitremote-v
git status
Gitremote add OPS15 [email Protected]:/home/ops/ops_controller
Gitadd. (git Add.) -a)
Git add-a
git add youfile
Git stash
Git diff
Git log-p
Git log-p-2
Git mergetool
Git branch
Git checkout
Git pull Origin Master
Git push Origin Master
Undo all changes to the workspace
Git checkout.
Undo modification of the specified file in the workspace
git checkout <youfile>
Undo all the stage areas to the workspace
git reset.
View all Branches
Git branch
Delete a specified branch
git branch-d <you branch>
View the submission status for each branch
Git branch-v
Create a new branch
Git branch <new branch>
This article is from the "Tridewah operation and maintenance work Road" blog, please be sure to keep this source http://cuidehua.blog.51cto.com/5449828/1783912
Common git operations