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 7193909
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T20:15:52+00:00 2026-05-28T20:15:52+00:00

A common problem when dealing with fixes is to work out what releases given

  • 0

A common problem when dealing with fixes is to work out what releases given fixes have been applied to, i.e “is this fix in release X”. What’s the best way in git to check what tagged release contains a given commit id.

Going through with gitk manually eye-balling a commit in a complex merge pattern is surprisingly hard.

So far the best solution we can come up with has been to use git-cherry:

git-cherry -v $TAG $COMMIT $COMMIT^

And see if it appears with a -. Is there a better way?

  • 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-28T20:15:54+00:00Added an answer on May 28, 2026 at 8:15 pm

    This is nice and easy to do, in fact, with the following command:

    git tag --contains f414f31
    

    That will list all the tags such that f414f31 is one of the tag’s ancestors, or the tag itself points to that commit.

    This is particularly useful for finding which versions of git contain a particular feature 🙂


    Update:

    To answer a further question in the comment below:

    Is there any easy way to find out all the equivalent commits that may have been applied to separate branches?

    You can find a hash of the patch introduced by the commit by using git patch-id – that’s the command that git cherry, git rebase, etc. use to find whether a commit has already been cherry-picked. So, if you want to find whether the change introduced by f414f31 was also introduced by a commit on the branch foo, you could always use a short shell script something like:

    patch_id () {
        git show $1 | git patch-id | cut -d ' ' -f1
    }
    
    P=$(patch_id f414f31)
    
    git rev-list foo | while read C
    do
        P2=$(patch_id $C)
        if [ x$P = x$P2 ]
        then
            echo "Also introduced by commit $C"
        fi
    done
    

    If you want to look across all branches, you can replace foo with --all. Jefromi‘s comment below suggests a couple of other refinements, e.g. you can add a break if you want to stop looking after the first match (sensible if you’re only searching a single branch), or exclude all ancestors of the original commit by using git rev-list foo ^f414f31 instead.

    Jefromi’s comment also reminds me that I should say a bit more about this approach. The documentation for git patch-id explains that the ID generated is “reasonably stable” – the line numbers and whitespace can change without affecting the ID, but if you had to fix any conflicts during the cherry-pick or rebase, you may end up changing the text of the patch. In that case, this wouldn’t find the commit.

    I’m sure you can also do this with an invocation of git cherry somehow, but I can never remember which way round the arguments are meant to go… 😉

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

Sidebar

Related Questions

This is a common problem for all developers, I am looking for the best
I have a common problem but the common solutions seems don't work for me.
I know that this is very common problem and I have gone through almost
This is a common problem for me. I have a solution that contains a
Common problem I'm sure, but I can't figure it out. In my AndroidManifest.xml and
We have a common problem of moving our development SQL 2005 database onto shared
I have a quite common problem, as I saw in the various user groups
This must be a common problem because I see it in many published papers
This is a fairly common problem, it probably has a name, I just don't
This seems to be a common problem but I cannot find a solution. I

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.