<p>I'd like to script, preferably in rake, the following actions into a single command:</p>

<ol>
<li>Get the version of my local git repository.</li>
<li>Git pull the latest code.</li>
<li>Git diff from the version I extracted in step #1 to what is now in my local repository.</li>
</ol>

<p>In other words, I want to get the latest code form the central repository and immediately generate a diff of what's changed since the last time I pulled.</p>

This is very similar to a question I asked about
how to get changes on a branch in git
. Note that the behaviour of git diff vs. git log is inconsistently different when using two dots vs. three dots. But, for your application you can use:
```
```
git fetch
git diff ...origin
```
```
After that, a
```
git pull
```
will merge the changes into your HEAD.