Find long SHA from short SHA for git diff

I was generating difference / changes done in the commit so that I can upload it in ReviewBoard.

I used “git show d9f7121e8ebd4d1f789dab9f8214ada2h480b9cf”. It gave me diff something like…

  • Merge files with different end-of-line character
  • External git difftool is not working on windows
  • Is it possible to have all “git diff” commands use the “Python diff”, in all git projects?
  • Git: what does the number of +/- signs in diff / merge output mean?
  • Github commit, diff does not show changes
  • Is there a metadata exclusion filter for the SVN DIFF command?
  • diff --git a/src/index.php b/src/index.php
    index 3cfa8e8..7f8440d 100644
    --- a/src/index.php
    +++ b/src/index.php
    @@ -12,10 +12,13 @@
     .test {
         width: auto;
    +    border-width: 5px;
    +    border-radius: 50%;

    When I create .patch file of this diff. Reviewboard rejects it saying “‘3cfa8e8’ revision is not valid format. SHA1 is too short”.

    So I wanted to get long SHA1 from short SHA1 ‘3cfa8e8’.

    I did ‘git show 3cfa8e8’. It just shows me some content of file. Doesn’t show me anything else.

    Any help how can I get long SHA?

    (Note:- All the sha and file diff are example to demonstrate the problem)

  • Github configuration for school
  • Search for and view a file deleted from the repo
  • Accidentally made my Netbeans Project folder a github repository
  • Github, push a new project in place of an old one
  • How to read Git 3-way unified diff output format?
  • Gemfile.lock not checked in - Heroku
  • One Solution collect form web for “Find long SHA from short SHA for git diff”

    git rev-parse <short sha> should do the trick.

    See also the git rev-parse manpage.

    Git Baby is a git and github fan, let's start git clone.