查看当前分支

# 查看当前分支
git branch
git branch --list

显示所有分支

git branch --all

创建分支

git branch 分支名

强制移动分支指针

# 让 main 分支强制指向 HEAD 前 3 个提交
git branch -f main HEAD~3

查看关联信息

git branch -vv

取消关联上游

git branch --unset-upstream

本地新建远程对应分支

# git 本地新建远程对应分支
git checkout -b local-branch-name origin/remote-branch-name