Git实战指南----跟着haibiscuit学Git(第六篇)
笔名: 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(第六篇)的更多相关文章
- Git实战指南----跟着haibiscuit学Git(第五篇)
笔名: haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...
- Git实战指南----跟着haibiscuit学Git(第十一篇)
笔名: haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...
- Git实战指南----跟着haibiscuit学Git(第九篇)
笔名: haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...
- Git实战指南----跟着haibiscuit学Git(第一篇)
笔名: haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...
- Git实战指南----跟着haibiscuit学Git(第二篇)
笔名: haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...
- Git实战指南----跟着haibiscuit学Git(第十篇)
笔名: haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...
- Git实战指南----跟着haibiscuit学Git(第八篇)
笔名: haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...
- Git实战指南----跟着haibiscuit学Git(第七篇)
笔名: haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...
- Git实战指南----跟着haibiscuit学Git(第四篇)
笔名: haibiscuit 博客园: https://www.cnblogs.com/haibiscuit/ Git地址: https://github.com/haibiscuit?tab=re ...
随机推荐
- CentOS7.4系统下,手动安装MySQL5.7的方法
MySQL数据库应用广泛,尤其对于JAVA程序员,不会陌生.如果在不想采购云数据库的情况下,可以自行安装MySQL数据库.文章将介绍,手动在CentOS7.4环境下,安装MySQL5.7版本的方法. ...
- 让微信推送Jenkins构建消息
Jenkins作为开发必备之神器,各家大小公司都在使用.Jenkins自身内置了基于邮件推送构建结果的功能.但是随着移动互联网的发展,邮件这玩意已经越来越少使用了,是否有一种办法能把jenkins构建 ...
- WARNING: Your kernel does not support swap limit capabilities. Limitation discarded.
利用vSphere调整各台虚拟机后,重新启动mesos,让其启动docker,并为每个container分配cpu和mem,但每次都有一个TASK_LOST. 查看mesos slave的log,发现 ...
- native-base中Input,Textarea等组件在ios平台下不能输入中文
在上文react-native中TextInput在ios平台下不能输入中文已经解决. 但是在native-base中Input和Textarea都存在这样的问题.为了不要写多个组件,封装以下代码: ...
- 用jquery实现楼层滚动对应导航高亮
html 结构排版: // 定位到页面左侧或者右侧 <div class="nav"> <ul id="menu-list"& ...
- 大数据之Linux进阶指令
1.文件内容操作相关命令 cut 根据条件 从命令结果中 提取 对应内容 -c 按字符选取内容 例子:head -2 1.txt | cut -c 5 截取前两行的第五个字符 -d '分隔符' ...
- Jomoo的模板
目录 1 杂类算法 1.1 快读模板 1.2 O(1) int64 乘法 2 图论算法 2.1 树类 - Trie 2.2 树类 - 并查集(NB version) 2.3 树类 - LCA 2.4 ...
- [Input-number]数字输入框组件
需求 加.减按钮 初始值 最大.最小值 数值改变时,触发一个自定义事件来通知父组件 目录文件 index.html 入口页 input-number.js 数字输入框组件 index.js 根实例 实 ...
- kubernetes-概念
kubernetes内部组件工作原理 http://dockone.io/article/5108 一.Master Master是整个集群的控制中心,kubernetes的所有控制指令都是发 ...
- SpringSpringBoot上传文件到七牛云
准备工作 maven pom.xml添加七牛云的sdk依赖 <dependency> <groupId>com.qiniu</groupId> <artifa ...