markdown 关于如何(和为什么)持续变革的很好的指示

Posted

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了markdown 关于如何(和为什么)持续变革的很好的指示相关的知识,希望对你有一定的参考价值。

p. Using <code>git-rebase</code> helps create clean commit trees and makes keeping your code up-to-date with the current state of the upstream master easy. Here's how it works.

p. Let's say you're working on Issue #212 a new plugin in your own branch and you start with something like this:

<pre>
<code>
          1---2---3 #212-my-new-plugin
         /
    A---B #master
</code>
</pre>

p. You keep coding for a few days and then pull the latest upstream stuff and you end up like this:

<pre>
<code>
          1---2---3 #212-my-new-plugin
         /
    A---B--C--D--E--F #master
</code>
</pre>

p. So all these new things (C,D,..F) have happened since you started. Normally you would just keep going (let's say you're not finished with the plugin yet) and then deal with a merge later on, which becomes a commit, which get moved upstream and ends up grafted on the tree forever.

p. A cleaner way to do this is to use rebase to essentially rewrite your commits as if you had started at point F instead of point B. So just do:

<pre>
<code>
git rebase master 212-my-new-plugin
</code>
</pre>

p. git will rewrite your commits like this:

<pre>
<code>
                      1---2---3 #212-my-new-plugin
                     /
    A---B--C--D--E--F #master
</code>
</pre>

p. It's as if you had just started your branch. One immediate advantage you get is that you can test your branch now to see if C, D, E, or F had any impact on your code (you don't need to wait until you're finished with your plugin and merge to find this out). And, since you can keep doing this over and over again as you develop your plugin, at the end your merge will just be a fast-forward (in other words no merge at all).

p. So when you're ready to send the new plugin upstream, you do one last rebase, test, and then merge (which is really no merge at all) and send out your pull request. Then in most cases, Gina has a simple fast forward on her end (or at worst a very small rebase or merge) and over time that adds up to a simpler tree.

p. More info on the git man page here: 
"Git rebase: man page":http://schacon.github.com/git/git-rebase.html

以上是关于markdown 关于如何(和为什么)持续变革的很好的指示的主要内容,如果未能解决你的问题,请参考以下文章

云原生应用架构中的文化变革 二:从间接均衡到持续交付!「敏捷开发大揭秘 — 价值驱动成长 !」

云原生应用架构中的文化变革 二:从间接均衡到持续交付!「敏捷开发大揭秘 — 价值驱动成长 !」

关于如何在安卓的百度地图开发里面简单实现持续定位

持续测试 | 测试流程提效:在 CODING 中实践迭代内的持续测试

CAS持续提升变革能力,加速生命科学创新

四川平凡节点持续加注IPFS,称分布式存储文件系统是伟大变革