笔名:  haibiscuit

博客园: https://www.cnblogs.com/haibiscuit/

Git地址: https://github.com/haibiscuit?tab=repositories  (欢迎star)

本项目地址: https://github.com/haibiscuit/StudyBook

尊重笔者的劳动成果,未经允许请不要转载

五:分支操作

创建分支

(1) 场景一 本地和远程分支都存在(关联分支)

git branch --set-upstream-to=origin/dev dev

(2) 场景二 本地分支dev存在,但远程分支不存在

git push --set-upstream origin dev   //远程创建dev分支并与本地建立关联

(3) 场景三 远程分支存在,需要新建对应的本地分支

git checkout --track origin/dev

其他分支操作

(1) 查看本地仓库和远程仓库的关系

git branch -vv

(2) 列出本地和远程分支

git branch -a

(3) 查看远程分支

git branch -v

(4) 创建并切换到本地分支

git checkout -b <branch-name>

(5) 从远程分支中创建并切换到本地分支

git checkout -b <branch-name> origin/<branch-name>

(6) 删除本地分支

git branch -d <local-branchname>

(7) 删除远程分支

git push origin --delete <remote-branchname>

或者

git push origin :<remote-branchname>

(8) 重命名本地分支

git branch -m <new-branch-name>

Git实战指南----跟着haibiscuit学Git(第六篇)的更多相关文章

  1. Git实战指南----跟着haibiscuit学Git(第五篇)

    笔名:  haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...

  2. Git实战指南----跟着haibiscuit学Git(第十一篇)

    笔名:  haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...

  3. Git实战指南----跟着haibiscuit学Git(第九篇)

    笔名:  haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...

  4. Git实战指南----跟着haibiscuit学Git(第一篇)

    笔名:  haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...

  5. Git实战指南----跟着haibiscuit学Git(第二篇)

    笔名:  haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...

  6. Git实战指南----跟着haibiscuit学Git(第十篇)

    笔名:  haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...

  7. Git实战指南----跟着haibiscuit学Git(第八篇)

    笔名:  haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...

  8. Git实战指南----跟着haibiscuit学Git(第七篇)

    笔名:  haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...

  9. Git实战指南----跟着haibiscuit学Git(第四篇)

    笔名:  haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...

随机推荐

  1. postgresql,postgis,geoserver 发布地图服务,并用.net mvc openlayers3进行显示

    1.所需工具 postgres版本 9.6.1 对应的postgis geoserver 2.8.2 openlayers3 2.将postgres postgis ,geosever安装好,再用如下 ...

  2. L1 loss, L2 loss以及Smooth L1 Loss的对比

    总结对比下\(L_1\) 损失函数,\(L_2\) 损失函数以及\(\text{Smooth} L_1\) 损失函数的优缺点. 均方误差MSE (\(L_2\) Loss) 均方误差(Mean Squ ...

  3. UICollectionView 相关方法

    最近闲来无事,整理一下UICollectionView的相关方法以备使用 UICollectionViewFlowLayout和UICollectionViewLayout UICollectionV ...

  4. Node.js 中 __dirname 和 ./ 的区别

    概要 __dirname 总是指向被执行 js 文件的绝对路径 在 /d1/d2/myscript.js 文件中写了 __dirname, 它的值就是 /d1/d2 . ./ 会返回你执行 node ...

  5. JavaScript基础3

    While循环 在指定条件为真时循环执行代码块.先确定条件再执行代码 语法 while(条件) { 需要执行的代码 } 条件中所用变量如果没有值,循环就不会停下,会导致浏览器崩溃: do...whil ...

  6. HDU5919 Sequence II(主席树)

    Mr. Frog has an integer sequence of length n, which can be denoted as a1,a2,⋯,ana1,a2,⋯,anThere are ...

  7. UESTC-1963咸鱼咕咕咕(二分图匹配)

    咸鱼咕咕咕 Time Limit: 1000 MS     Memory Limit: 64 MB Submit Status 咸鱼有个咕咕笼. 咕咕笼可以划分成m×nm×n个格子,每个小格子可以放下 ...

  8. Socket无法通过防火墙的问题

    无论是配好端口还是例外的应用程序都不行 更改本地终结点为 socket.Bind()); IPAddress.Any 不要使用127.0.0.1 不要使用127.0.0.1 不要使用127.0.0.1

  9. 【JS】388- 深入了解强大的 ES6 「 ... 」 运算符

    本文原载于 SegmentFault 社区 专栏:大前端  作者:皮小蛋 背景 ... 运算符,是 ES6 里一个新引入的运算法,也叫 展开/收集 运算符,我们每天都要和它打交道. 这篇文章,我就带你 ...

  10. screen虚拟终端工具

    说明:有时候我们要执行一个命令或脚本,需要几小时甚至几天,但是不能中断,有时想查看当前输出信息的时候,可以将它丢到后台运行,但是后台运行却无法显示或输出相关信息出来:我们可以使用一个虚拟终端工具scr ...