git clone 服务器地址
git checkout -b hotfix 等于 git branch hotfix + git checkout hotfix
git checkout hotfix
git push origin hotfix
git push --set-upstream origin HEAD
git branch (本地分支) git branch -vv (带关系) git branch -a (带远程分支)
在远程分支的基础上建立分支,并且追踪origin/branch-name远程分支。
将branch-name分支追踪远程分支origin/branch-name
将当前分支跟踪远程分支origin/branch-name
自动将创建好的branch-name分支追踪origin/branch-name分支
git diff git status -s
git add . 查看添加 git diff --staged
git commit 查看提交 git show
git push 查看push结果 git show HEAD
git rebase -i master git checkout master git push
git fetch 等于 git fetch origin branch-name
git diff HEAD FETCH_HEAD git diff HEAD origin/branch-name
git merge 等于 git merge origin/branch-name
git pull 等于 git fetch origin branch-name + git merge origin/branch-name
vscode 五、删除分支
git push origin :branch-name
git branch -d hotfix 六、其他
git log --oneline --decorate --graph —all 可视化 Sourcetree
git stash git stash list git stash pop