Tags
List Tags : git tag -l
Check a specific tag : git checkout tags/<tag_name>
Sync with Remote
git fetch origin
git reset --hard origin/master
git clean -f -d
Remote
git remote 用来管理本地的remote,在这里是服务器上的repo在本地成为remote。
git remote -v 显示所有的remote
git remote remove vso 删除本地名为vso的remote
git remote set-url originhttps://xxx.visualstudio.com/DefaultCollection/xxx/_git/xxxxx 更新本地名为origin的remote的地址
Merge vs. Rebase
Branch
git branch <new-branch> 创建新branch
git checkout <branch> 切换branch
git checkout -b <new-branch> 创建并切换到新branch
Commit to local repo andpush to branch
git commit -m"commit comment"
git push origin<branch>
Hard Pull
git reset --hard origin/master
Diff
git difftool
配置difftool使用Beyond Compare
git config --global diff.tool bc4
git config --global difftool.bc4.cmd '\"c:/program files (x86)/beyond compare 4/bcomp.exe\" \"$LOCAL\" \"$REMOTE\"'
git config --global merge.tool bc4
git config --global mergetool.bc4.cmd '\"c:/program files (x86)/beyond compare 4/bcomp.exe\" \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\"'
git config --global mergetool.bc4.trustExitCode true
Sub module
git submodule init
git submodule update // sync the submodule to local
https://chrisjean.com/git-submodules-adding-using-removing-and-updating/ (how to upgrade submodule references)
git submodule update --init --recursive // sync the submodule to local recursively
git submodule foreach --recursive git fetch
git submodule foreach git merge origin master