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