git之remote branch controller(远程分支控制)

时间:2023-03-09 09:52:06
git之remote branch controller(远程分支控制)

1、创建本地分支

  git branch  //查看远程分支

  git之remote branch controller(远程分支控制)

  git checkout -b branch_name //创建远程分支

  git之remote branch controller(远程分支控制)

  在查看分支git branch

  git之remote branch controller(远程分支控制)

2、将分支提交到远程仓库

  git之remote branch controller(远程分支控制)

  此时远程库中会有test-branch分支:

  git之remote branch controller(远程分支控制)

6、删除远程分支

  首先,当前所在分支不能被删除,若要删除需切换到其它分支:

  git之remote branch controller(远程分支控制)

  删除本地分支git branch -d test-branch

  git之remote branch controller(远程分支控制)

  删除远程分支git push origin :test-branch

  git之remote branch controller(远程分支控制)

  此时远程仓库之前的test-branch分支已经没有了

  git之remote branch controller(远程分支控制)