zoukankan      html  css  js  c++  java
  • 三分钟教你学Git(十二) 之 fast-forward

    什么是fast forward, 顾名思义,就是高速向前进,Git怎么做到高速的呢?


    原来假设Git判定能够fast forward的时候,直接改动当前HEAD指针的指向然后再改动当前HEAD指针。说白了就是改动两个指针的指向。而并没有生成新的commit对象。


    所以当你改动了当中的一个branch中的某个commit的时候,还有一个branch假设也引用了此commit。则这个branch会非常意外的出现变化,由于引用的是同一个commit对象。


    所以一般有几种方法:

    1 --no-ff

    显示告诉Git不要fast forward

    2 cherry-pick

    3 --squash

    将全部commit合并成一个commit,这样肯定是生成一个新的commit。


    原文:http://blog.csdn.net/hongchangfirst/article/details/45484191

    作者:hongchangfirst

    hongchangfirst的主页:http://blog.csdn.net/hongchangfirst



  • 相关阅读:
    leetcode122
    leetcode121
    leetcode773
    leetcode803
    leetcode658
    leetcode723
    leetcode134
    leetcode340
    leetcode721
    leetcode362
  • 原文地址:https://www.cnblogs.com/tlnshuju/p/6888125.html
Copyright © 2011-2022 走看看