Git分支

66 阅读1分钟

基于当前分支检出并切换到新的分支

git checkout -b branch_name

基于远程分支检出并切换到新的分支

git checkout -b branch_name origin/remote_branch_name

基于远程分支检出新的分支(没有关联性,不推荐使用)

git fetch origin remote_branch_name:branch_name

修改分支名称

git branch -m old_branch_name new_branch_name

删除分支

git branch -D branch_name