git分支问题

获取指定分支: git clone -b 851 https://gitee.com/xigedianshang/grazy85.git  grazy851

切换分支: git checkout 分支名称

合并分支:先切换到主分支 

git merge 分支名称

分支常用命令:

git branch -r       #查看远程所有分支

git branch           #查看本地所有分支

git branch -a       #查看本地及远程的所有分支,如下图

git fetch   #将某个远程主机的更新,全部取回本地:

git branch -a  #查看远程分支 git branch #查看本地分支: git checkout 分支 #切换分支: git push origin -d 分支名 #删除远程分支: git branch -d 分支名 #删除本地分支 git remote show origin #查看远程分支和本地分支的对应关系 git remote prune origin #删除远程已经删除过的分支

猜你喜欢

转载自www.cnblogs.com/finnlee/p/11320196.html