git remote -v
git remote set-url origin git@github.com:fanqingsong/vanna-flask.git
git remote set-url --push origin git@github.com:fanqingsong/vanna-flask.git
git remote show origin
git branch -r
git branch
git checkout -b xxx
git config --global alias.st status
git config --global alias.ci commit
git config --global alias.co checkout
example:
git config --global alias.unstage 'reset HEAD'
git unstage test.py
git reset HEAD test.py
git push origin --tags
git push origin tagname
git push origin master:refs/for/master
git push origin HEAD:refs/drafts/master
git push origin master:refs/heads/master
git remote add review https://xxxx
git config remote.review.pushurl https://xxx
git config remote.review.push 'HEAD:refs/drafts/master'
git push origin master
git push origin dev
git reset --hard origin/master
git reset --soft origin/master
git add -u
git reset -- static/js/dashboard.js
git stash pop
git stash apply xxx
git stash drop xxx
git diff > patch
git diff HEAD HEAD^ > patch
git format-patch HEAD^
git format-patch commit_new commit_old
git apply patch
git apply --check patch
git reset --hard HEAD^
git reset --hard HEAD~100
git reset --hard 3628164
git log --graph --pretty=oneline --abbrev-commit
git reset --hard commit_id
git cherry-pick 00940ac970b9ddab63bff928479668bbfa293aaf
git cherry-pick commit1..commit100
git checkout feature/new1.1 -- usercontroller.php
git checkout -b mywork origin
git checkout -b dev origin/dev
git branch -d feature-discuss
// 删除本地分支
git branch -d localBranchName
// 删除远程分支
git push origin --delete remoteBranchName
git merge --no-ff another_branch
git diff
git diff HEAD HEAD^
git diff HEAD HEAD^ --name-only
git show HEAD --name-only
git diff readme.txt
git tag <tagname>
# Git will create a tag at the current revision but will not prompt you for an annotation. It will be tagged without a message (this is a lightweight tag).
git tag -a <tagname>
# Git will prompt you for an annotation unless you have also used the -m flag to provide a message.
git tag -a -m <msg> <tagname>
# Git will tag the commit and annotate it with the provided message.
git tag -m <msg> <tagname>
# Git will behave as if you passed the -a flag for annotation and use the provided message.
git config --global user.email "qsfan@qq.com"
git config --global user.user "fanqingsong"
git config --global credential.helper store
git config --global credential.helper
git config --unset credential.helper
git credential-store clean
git pull origin next
==
git fetch origin master
git merge FETCH_HEAD