git 分支常用命令清单,包括git branch
git switch
git merge
1 git-branch
1.1 查询
git branch git branch -l git branch --list
git branch -r git branch --remotes git branch -lr git branch --list --remotes
git branch -a git branch --all
git branch -vv git branch --verbose --verbose
|
1.2 创建与删除
git branch <new-branch>
git branch --track <new-local-branch> <remote-branch>
git branch -d <branch> git branch --delete <branch>
git branch -D <branch> git branch --delete --force <branch>
git branch -dr <remote/branch> git branch --delete --remote <remote/branch>
git push -d <remote> <branch> git push --delete <remote> <branch>
|
1.3 移动(重命名)与复制
git branch -m [current-branch] <new-branch> git branch --move [current-branch] <newbranch>
git branch -m <target-branch> <new-branch> git branch --move <target-branch> <new-branch>
git branch -c <new-branch> [current-branch] git branch --copy <new-branch> [current-branch]
|
1.4 其他
git branch -u <remote-branch> git branch --set-upstream-to=<remote-branch>
|
2 git-switch
git switch <target-branch>
git switch -c <new-branch> git switch --create <new-branch>
git switch --orphan <new-branch>
|
3 git-merge
git merge <target-branch>
|
参考资料
更新日志