git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: Show current SHA1

From
TLTeemu Likonen <tlikonen@iki.fi>
Date
Jul 11, 2009, 09:55 UTC
Message-ID
<874otjlf22.fsf@iki.fi>
In-Reply-To
<9586f3420907110239nbc35aealb473e1f1b3667410@mail.gmail.com>
On 2009-07-11 10:39 (+0100), Allan Kelly wrote:
> The question then is: what is the command to report the current SHA1?
> Note I never branch in the HTML repo, it's entirely linear.

If the "current SHA1" means "the SHA1 of the most recent commit in the current branch" then usually

    git show

is the simplest way. There are many ways to print _only_ the SHA1. Examples:

    git log -1 --pretty=format:%H
    git rev-list -1 HEAD
Previous: Allan KellyNext: Charles Bailey
Message 2 of 4 in “Show current SHA1”
  1. Allan KellyJul 11, 2009
  2. Teemu LikonenJul 11, 2009
  3. Charles BaileyJul 11, 2009
  4. Heinrich NirschlJul 11, 2009

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.