一:

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. ubuntu配置小飞机

    现在有两种方式在ubuntu配置本地shadowsocks(前提已经在服务器上搭建好了ss) windows,ios和安卓配置都是gui,没什么好说的.然后前期工作什么买vps啊,比较无脑,不想记录这 ...

  2. net core体系-Standard-1概述

    前言 早上起来.NET社区沸腾了,期待已久的.NET Core 2.0终于发布!根据个人经验,微软的产品一般在2.0时会趋于成熟,所以一个新的.Net开发时代已经来临!未来属于.NET Core. . ...

  3. 权限的控制 shiro的使用

    ******shiro的使用 三大核心组件 Subject:即当前用户,在权限管理的应用程序里往往需要知道谁能够操作什么,谁拥有操作该程序的权利,shiro中则需要通过Subject来提供基础的当前用 ...

  4. babel分析

    现在都用 ES6 新语法以及 ES7 新特性来写应用了,但是浏览器和相关的环境还不能友好的支持,需要用到 Babel 转码器来转换成 ES5 的代码 相信大家都看到过如下的名词: babel-pres ...

  5. python控制语句---循环结构语句

    这次主要把循环结构的控制语句补上,主要包含while.for.continue.break.循环嵌套.主要写一些基本的认识以及包含的一些实例.当只有唯一路径且只跑一次的时候选择上一节中的选择结构语句就 ...

  6. mpvue中使用wxParse,解析a标签跳转问题

    安装:npm i mpvue-wxparse js:import wxparse from "mpvue-wxparse"; css:@import url('~mpvue-wxp ...

  7. 【2019雅礼集训】【CF 960G】【第一类斯特林数】【NTT&多项式】permutation

    目录 题意 输入格式 输出格式 思路 代码 题意 找有多少个长度为n的排列,使得从左往右数,有a个元素比之前的所有数字都大,从右往左数,有b个元素比之后的所有数字都大. n<=2*10^5,a, ...

  8. Win10 安装Oracle11g2、配置PL/SQL Developer11环境

    Oracle11g2的下载地址(下载以下两个压缩包,解压后得到两个oracle目录,放到一起就得到完整的安装文件了): 1.Oracle11g2: oracle-part-1 oracle-part- ...

  9. lua_table 学习

    lua  table (表)   Table 的常用操作   local fruits = {“aaa”,”bbb”,”ccc”,”ddd”,”eee”,”fff”,”ggg”}   table.co ...

  10. jquery固定表头和列头

    1.对网上的开源方法稍作了些修改 <script type="text/javascript">// <![CDATA[ function FixTable(Ta ...