snipt

Ctrl+h for KB shortcuts

Bash

Show latest branch activity in Git

for k in `git branch|perl -pe s/^..//`;do echo -e `git show --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" $k|head -n 1`\\t$k;done|sort -r
https://snipt.net/embed/b19e52b4fa804023dfd0754e8bfd7f03/
/raw/b19e52b4fa804023dfd0754e8bfd7f03/
b19e52b4fa804023dfd0754e8bfd7f03
bash
Bash
1
2019-07-03T12:23:07
True
False
False
Oct 26, 2012 at 04:51 AM
/api/public/snipt/49081/
show-latest-branch-activity-in-git
<table class="highlighttable"><tr><td class="linenos"><div class="linenodiv"><pre><a href="#L-1">1</a></pre></div></td><td class="code"><div class="highlight"><pre><span></span><span id="L-1"><a name="L-1"></a><span class="k">for</span> k in <span class="sb">`</span>git branch<span class="p">|</span>perl -pe s/^..//<span class="sb">`</span><span class="p">;</span><span class="k">do</span> <span class="nb">echo</span> -e <span class="sb">`</span>git show --pretty<span class="o">=</span>format:<span class="s2">&quot;%Cgreen%ci %Cblue%cr%Creset&quot;</span> <span class="nv">$k</span><span class="p">|</span>head -n 1<span class="sb">`</span><span class="se">\\</span>t<span class="nv">$k</span><span class="p">;</span><span class="k">done</span><span class="p">|</span>sort -r </span></pre></div> </td></tr></table>
branch, git, show