Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7494715
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T17:44:03+00:00 2026-05-29T17:44:03+00:00

The situation: I have a tar.gz of a release from a github project but

  • 0

The situation: I have a tar.gz of a release from a github project but would like to work out which commit this was taken from. It doesn’t appear to have been tagged or is it obvious from commit message themselves.

So I can calculate sha1 of the files, but would like to work out which commit these belong to?

Calling git wizards!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-29T17:44:09+00:00Added an answer on May 29, 2026 at 5:44 pm

    Since the git-stored hash doesn’t just include the file contents (and, in theory, hash collisions happen anyhow), in order to be really sure you’ve got the right version of the file you need to compare the contents.

    for rev in $(git log --format=%H -- /path/to/file); do
       git diff --quiet $x:/path/to/file my-current-file;
       if [[ $? -eq 0 ]]; then
          echo $x;
       fi
    done
    

    In English: iterate over the revisions that changed the file, in reverse order. For each such revision, diff the version of the file there with the outside-the-tree file. If the two files are identical, print the revision hash.

    If you want to do this for the whole tarball, you can do the same but diff the whole tree instead of a single file (and omit the file path as an argument to git log) – use whatever tolerant diff options you like.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have situation like this: // Object Class class Person_Object { protected $_id; public
Situation: I have a wrapper panel UserControl like this (namespaces and visual details removed
Situation I have been working on a project lately where the UI development seems
Situation: I have an Xcode project based on the Navigation-Based-Application template. So that means
Situation: I have a web application which shows errors and where you can accept
I have situation where I generate stylesheets based on information in the database. This
Situation: I have a C# program which does the following: Generate many files (replacing
I have following situation: I have a Maven war project in NetBeans 6.7 I
Situation I have web application I have class which does complicated mathematics computation Equations
[Situation] I have a custom item control which I add to a stack panel

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.