Show most recent commit on each remote branch on origin using `git for-each-ref` and `git log`
<p>Having done <code>git fetch --all --prune</code> to fetch refs from the remote repositories I now want to see the most recent commit on each of the branches on <code>origin</code></p>

<p>The command </p>

<pre><code>git for-each-ref --format='%(refname:short)' | grep 'origin/'
</code></pre>

<p>lists all sixteen branches on <code>origin</code>, and so I would expect the following command to show the most recent commit from each one</p>

<pre><code>git for-each-ref --format='%(refname:short)' | grep 'origin/' | 
xargs git log --source -n 1 
</code></pre>

<p>(N.B. This is one line when I run it; I have split it over two for readability.)</p>

<p>However the command does not work, it only lists one commit: it seems the one commit limit applies to the entire list and not to each branch in turn.</p>

<p>What am I doing wrong?</p>

<p>(Note that I have also tried to adapt the solution <a href="https://stackoverflow.com/a/11435371/575530">here</a></p>

<pre><code>git for-each-ref --format='%(refname:short)' | grep 'origin/' | 
xargs git show --oneline 
</code></pre>

<p>but the <code>--oneline</code> flag is ignored and the result is too verbose.)</p>