Follow the public account QXF069

Git clone path [] Specifies the name of the file.

Check the address of the remote repository git remote – v | — verbose

Git remote add [-t branch] <name(origin)> # Git remote add [-t branch] <name(origin)> You can specify multiple -t parameters to synchronize these specific branches down

Git remote rm <name(origin)>

Git remote prune [–dry-run] <name(origin)># Git remote prune [–dry-run] <name(origin)>#

List the local branch (a #) in front of the current branch git branch [v] [-r | — remotes | | – a – all] [v | – vv]

-v Displays redundant information (commitId and comments submitted last time)

-vv Displays redundant information, including the corresponding up-stream

-r or –remtotes to view remote branches (only view local branches without -r or -a)

-a or –all View all branches (local + remote)

Delete local branch (delete) the git branch – # d | – d – d if the code is not merged, not to delete

-d Forcibly deletes branches regardless of merge

Rename branch name (move/rename) git branch – m | # -m -m if the nuptial branch, not to rename # – m if you have the nuptial branch, forced to rename oldBranchName newBranchName, And replace the old newBranchName

Git branch []# If you want to create a new branch and switch to a new branch, you can use: git checkout -b # If not specified, the new branch will point to the HEAD of the current branch, otherwise it will point to the corresponding COMMIT

Git branch –track develop origin/ git branch –track develop origin

Git fetch <name(origin)>

Git merge –no-ff # –no-ff

If the merge git merge cannot be fast-forward, do not merge git merge –ff-only

Git pull is equivalent to git pull Origin

Get the remote branch and merge it with the current branch git pull –no-ff origin

Push the remote library git push Origin

Git delete origin:

Git commit [-a | — all] -m “” # if you specify – a parameter, the modified or deleted files, although is not add, but will also be submitted (new file will not); If the -a parameter is not specified, only files added will be submitted # -m submit comments

Git commit -c head -a –amend # If the commit has not been pushed to the remote end

Switch to the branch git Checkout

Git checkout -b [] # if not specified, checkout from the HEAD of the current branch

Git checkout <fileName/directoryName

Git revert Head

Git reset –hard head^^

If you add reset mode without display, the default is mixed mode

Reset mode HEAD Working directory of the location temporary area

Soft Modify No change no change

Mixed Modify Modify Does not modify

Change # head^^ to back up to the third version from head.

Check the staging stack Git Stash list

Git statsh drop []

Git status git status

Use GUI to view history gitk

Using the command line to view the history the git log [-n | -] [p] – [- pretty = format: “” | – pretty = (oneline | short | full)] [– graph] [] [– grep =] [– after =] [–before=] [–author=] [–committer=]

View the file status git ls – files [-t] [-c] [-d] [m] – [-] o [-u] [< fileName/directoryName >]

Create git tag 1.0

Create a label for a commit

1.0 1 b2e1d63ff git tag

Display label list

git tag

Switch to TAB (view only, not submit)

Git checkout 1.0

Git FSCK –lost-found #

If so, you can use Git rebase or Git Merge to recover

Concerned public Account: