一:

To create a new branch and switch to it at the same time, you can run the git checkout command with the -b switch:

$ git checkout -b iss53
Switched to a new branch "iss53"

This is shorthand for:

$ git branch iss53
$ git checkout iss53
https://git-scm.com/book/en/v2/Git-Branching-Basic-Branching-and-Merging

二:The iss53 branch has moved forward with your work

However, before you do that, note that if your working directory or staging area has uncommitted changes that conflict with the branch you’re checking out, Git won’t let you switch branches. It’s best to have a clean working state when you switch branches。

You can run your tests, make sure the hotfix is what you want, and finally merge the hotfixbranch back into your master branch to deploy to production. You do this with the git mergecommand:

$ git checkout master
$ git merge hotfix
Updating f42c576..3a0874c
Fast-forward
index.html | 2 ++
1 file changed, 2 insertions(+)

You’ll notice the phrase “fast-forward” in that merge. Because the commit C4 pointed to by the branch hotfix you merged in was directly ahead of the commit C2 you’re on, Git simply moves the pointer forward.  To phrase that another way, when you try to merge one commit with a commit that can be reached by following the first commit’s history, Git simplifies things by moving the pointer forward because there is no divergent work to merge together — this is called a “fast-forward.”

三:

Suppose you’ve decided that your issue #53 work is complete and ready to be merged into your master branch. In order to do that, you’ll merge your iss53 branch into master, much like you merged your hotfix branch earlier. All you have to do is check out the branch you wish to merge into and then run the git merge command:

$ git checkout master
Switched to branch 'master'
$ git merge iss53
Merge made by the 'recursive' strategy.
index.html | 1 +
1 file changed, 1 insertion(+)

This looks a bit different than the hotfix merge you did earlier. In this case, your development history has diverged from some older point. Because the commit on the branch you’re on isn’t a direct ancestor of the branch you’re merging in, Git has to do some work. In this case, Git does a simple three-way merge, using the two snapshots pointed to by the branch tips and the common ancestor of the two.



英语笔记3(git)的更多相关文章

  1. Git 笔记三 Git的初步使用

    Git 笔记三 Git的初步使用 在上一篇中,学习了如何配置Git环境,这一篇,开始学习Git的初步使用.Git的初步使用还是很简单的.总体上知道git init, git clone, git ad ...

  2. Git 笔记二-Git安装与初始配置

    git 笔记二-Git安装与初始配置 Git的安装 由于我日常生活和工作基本上都是在Windows上,因此此处只说windows上的安装.Windows上的安装和其他程序一样,只需要到http://g ...

  3. 英语笔记3(git)

    备注 一: Staging Modified Files Let’s change a file that was already tracked. (tracked 表示该文件已经被git管理过,再 ...

  4. Git 笔记一 Git简介

    git 笔记一 什么是版本控制 所谓版本控制就是记录对文件的修改记录,这样以后就能回退到需要的 版本.比如你对一段代码进行了几次修改,有几次修改不想要了,如果 使用了版本控制,就可以回退到未做这些修改 ...

  5. git的学习笔记(二):git远程操作

    1.创建ssh key ssh-keygen -t rsa -C "your_email@example.com" 执行命令后会在用户的家目录生成.ssh的隐藏文件夹,文件夹里有公 ...

  6. 项目管理---git----快速使用git笔记(一)------git的简单介绍

    最近svn代码管理服务器崩溃了,切换到git来运作. 经过几天的使用,感觉很不错. 尤其是代码合并到正式版本之前 可以对代码进行 code review. 这样能很好的保证团队的代码质量和一些重复代码 ...

  7. 笔记:git和码云

    背景:之前使用GitHub,无奈网速原因,有时候竟无法连接,搜索解决方案而又鱼龙混杂淹没在信息的海洋. 于是尝试码云,界面简单,全中文,用起来很是顺手. 码云使用git来管理,操作上都是git的基本指 ...

  8. 【学习笔记】Git的日常使用

    Note:本笔记是我学习廖雪峰老师的Git教程整理得到,在此向廖老师的无私付出表示衷心的感谢! 0.Git的历史 Git是一个分布式的版本控制系统(C语言编写,一开始为Linux社区服务,替代BitK ...

  9. 【笔记】Git简明教程

    前言 Git这个东西我曾经有学过,但学的内容太多了,有点懵,不太理解,磕磕碰碰的,走了不少弯路.不过最近我在B站上发现了一个讲的很好的教程:<表严肃讲Git>.因此,我决定用文字的方式分享 ...

随机推荐

  1. mysql记录执行的SQL语句

    show variables like "general_log%"; SET GLOBAL general_log = 'ON';SET GLOBAL general_log = ...

  2. [转] Vue中异步错误处理

    一般在一个项目开始之前,我们一般会对现有的框架做一定功能上的丰富,比如对ajax请求功能的二次封装,封装的功能可能包含了:通用错误处理,请求过滤,响应过滤等等.如果我们封装的函数叫request,那么 ...

  3. pkuwc2018题解

    题解: 思路挺好想的..然而今天写代码写成傻逼了 d1t1: 首先比较暴力的就是$f[i][j]$表示i个这个点是j的概率 然后前缀和一下dp就是$n^2$的 部分分树形态随机就说明树深度是$log$ ...

  4. 建造者模式(Builder Pattern)

    建造者模式(Builder Pattern) 它可以将多个简单的对象一步一步构建成一个复杂的对象. 意图:将一个复杂的构建与其表示相分离,使得同样的构建过程可以创建不同的表示. 主要解决:主要解决在软 ...

  5. 使用Tornado异步接入第三方(支付宝)支付

    目前国内比较流行的第三方支付主要有支付宝和微信支付,博主最近研究了下如何用Python接入支付宝支付,这里我以Tornado作为web框架,接入支付宝构造支付接口. 使用Tornado异步接入支付宝支 ...

  6. K-means算法性能评估及其优化

    1. SSE误差平方和(Sum of Square due to Error): 聚类情况: 计算公式: 注:SSE参数计算的内容为当前迭代得到的中心位置到各自中心点簇的欧式距离总和,这个值越小表示当 ...

  7. 应用中对APK进行安装

    权限 <uses-permission android:name="android.permission.REQUEST_INSTALL_PACKAGES"/> //允 ...

  8. sql基本语法

    sql基本语法 sql server 查询 多表查询 直接多表查询 select * from st_profiles,st_score_report 上面的语句将会产生两个表的笛卡尔乘积,其中大部分 ...

  9. 使用Jsoup实现java爬虫(非原创)

    1,查看页面源代码,使用css或者JQuery选择器方式或元素节点选择 例如: 或者写成:Elements elements1 = Jsoup.connect("http://jb.999a ...

  10. MyBatis3系列__06查询的几点补充

    关于查询的一点补充: 当查询部门信息时,希望查询该部门下的所有员工,下面会采取两种方式实现: 1.联合查询 public Department getDeptWithEmpById(Integer i ...