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 ...
随机推荐
- Spring通过IOC帮我们做火鸡
一.IOC--setter注入 1.准备dmo 首先准备一只火鸡 public class Turkey { private int id; private String name; public i ...
- Sql增加,删除,修改列
1. 查看约束条件 - MySQL: SELECT * FROM information_schema.`TABLE_CONSTRAINTS` where table_name = 'book'; - ...
- 集合<class'set'>
>>> s = {1,2,3,4} >>> s&{1,3}{1, 3}>>> s|{11}{1, 2, 3, 4, 11}>> ...
- redis数据类型--set
set是String的一个无序集合,最大存储量2^32-1(大概40多亿) 1.操作命令:(xxx可以是任意字符串) sadd xxx a b c d e (添加一个或多个) smembers xxx ...
- [TimLinux] Python __hash__ 可哈希集合
规则: __hash__ 应该返回一个整数,hash()函数计算基础类型的hash值 可哈希集合:set(), forzenset(), dict() 三种数据结构操作要求 key 值唯一,判断唯一的 ...
- CoderForces999E-Reachability from the Capital
E. Reachability from the Capital time limit per test 2 seconds memory limit per test 256 megabytes i ...
- 2019 AI Bootcamp Guangzhou 参会日记
2019年的全球AI训练营在北京.上海.广州.杭州.宁波五个地方同时举办! 12月14日,微软全球AI Bootcamp活动再次驾临广州,本次会议结合 ML.NET 和基于 SciSharp 社区介绍 ...
- python数学工具(一)
python 数学工具包括: 1.函数的逼近 1.1.回归 1.2.插值 2.凸优化3.积分4.符号数学 本文介绍函数的逼近的回归方法 1.作为基函数的单项式 对函数 的拟合 首先定义函数并且可视化 ...
- JavaScript中的"奇奇怪怪"
filter等方法的隐式转化 var list = [1,,2,,0,5,9];console.log(list[1]); // console: undefinedconsole.log(list[ ...
- Day 02 计算机的基本组成及工作原理
目录 计算机的构成 CPU 控制器 运算器 存储器 内存 外存 I/O (input & output) 输入设备 输出设备 什么是编程语言 什么是编程 为什么要编程 多核CPU 32位和64 ...