tags/gitNico Schotteliushttps://www.nico.schottelius.org//tags/git/Nico Schotteliusikiwiki2016-02-25T13:34:32ZHow to show the latest git taghttps://www.nico.schottelius.org//blog/how-to-show-the-latest-git-tag/2016-02-25T13:34:32Z2015-02-11T10:21:16Z
<h2>TL;DR</h2>
<p>If you want to show the name of the latest tag, use:</p>
<pre><code>git for-each-ref --sort=-taggerdate --count=1 --format '%(tag)' refs/tags
</code></pre>
<h2>Some background</h2>
<p>The command <em>git for-each-ref</em> is pretty useful if you want to find something
in a number of commits (or tags in this case). It allows you to use variations of
output and sorting methods. For example:</p>
<h3>Show all tags including the message</h3>
<pre><code>git for-each-ref --format '%(refname) %(contents:subject)' refs/tags
</code></pre>
<p>(this is btw. very similar to <strong>git tag -n1</strong>)</p>
<h3>Show all tags sorted by date, oldest first</h3>
<pre><code>git for-each-ref --sort=taggerdate --format '%(refname)' refs/tags
</code></pre>
<h3>Show all tags sorted by date, newest first</h3>
<pre><code>git for-each-ref --sort=-taggerdate --format '%(refname)' refs/tags
</code></pre>
<h3>Show latest two tags</h3>
<pre><code>git for-each-ref --count=2 --sort=-taggerdate --format '%(refname)' refs/tags
</code></pre>
<h3>Show latest tag with its non-ambiguous short name</h3>
<pre><code>git for-each-ref --sort=-taggerdate --count=1 --format '%(refname:short)' refs/tags
</code></pre>
<h3>Show latest tag</h3>
<pre><code>git for-each-ref --count=1 --sort=-taggerdate --format '%(tag)' refs/tags
</code></pre>
<p>(note: this is the same as the previous one, but uses the <em>tag</em> field)</p>
Added new short commands to .gitconfig (lo, lco, lpc, lpco, m, pl)https://www.nico.schottelius.org//blog/dot-gitconfig-with-git-lo-lco-lpo-lpco-m-pl/2016-02-25T13:34:32Z2015-02-03T14:47:26Z
<p>As some of you are using my
<a href="https://www.nico.schottelius.org//configs/dot-gitconfig">git configuration</a>, there's an updated
version now, that includes a short version of <strong>--pretty=oneline</strong>
option for <strong>git log</strong>, which is very useful if you want to get
a quick impression on what is going on. Thus the new short commands
are (just an o added at the end):</p>
<pre><code>git lo
git lco
git lpo
git lpco
</code></pre>
<p>Furthermore I added the following new short commands:</p>
<pre><code>git m (merge)
git pl (pull)
</code></pre>
<p>Have fun, other lazy people like me!</p>
websiteshttps://www.nico.schottelius.org//about/websites/2016-02-25T13:34:32Z2015-02-03T14:47:26Z
<p>Over the years I created one and another website for a specific task.
Today there are plenty of websites currently up and running.</p>
<p>The idea of this site is to (sooner or later) consolidate some of the following ones:</p>
<ul>
<li><a href="http://nico.schotteli.us/">My very old personal website</a></li>
<li><a href="http://nico.schottelius.org/">My old personal website (being merged into this one)</a></li>
<li><a href="http://unix.schottelius.org/">UNIX related projects</a></li>
<li><a href="http://irc.schottelius.org/">irc related data/information</a></li>
<li>The public <a href="http://l.schottelius.org">mailing lists</a> hosted on <strong><em>l.schottelius.org</em></strong>.</li>
</ul>
<h2>This website</h2>
<p>This website is generated using the <a href="http://www.ikiwiki.info">ikiwiki software</a>.
Its source is maintained via <a href="http://git-scm.com/">git</a> and can be found in
<a href="http://git.schottelius.org/?p=netzseiten/www.nico.schottelius.org;a=summary">gitweb</a>
and cloned via</p>
<pre><code>git clone git://git.schottelius.org/netzseiten/www.nico.schottelius.org
</code></pre>
<h2>Old websites</h2>
<p>Websites (partially) migrated or stopped running can now be found on
<a href="https://www.nico.schottelius.org//tags/git/archive.schottelius.org">archive.schottelius.org</a>.</p>