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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T18:26:39+00:00 2026-05-26T18:26:39+00:00

i was wondering if there is a git command to see if a specific

  • 0

i was wondering if there is a git command to see if a specific commit is in the current working tree. I have the shasign of the specific commit. I like to know if this commit is a commit done by another user in another working tree or if it’s commit which is newer then the current HEAD of my working tree.

The reason i want to do this is, because we have a Jenkins server set up and there are builds done regularly, but i want to test the latest build to see if it’s the same as my HEAD, or if it’s an older commit, or if it’s a commit done by someone else.

  • 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-26T18:26:40+00:00Added an answer on May 26, 2026 at 6:26 pm

    I think by “in the current working tree” you must mean “in the history of HEAD”.

    To do the tests you describe, given the SHA1sum S, you can do the following:

    • To see if S is the same as your HEAD, compare git rev-parse --verify S with git rev-parse --verify HEAD
    • Otherwise, to see if it’s a commit in the history of HEAD, you can compare git merge-base S HEAD with git rev-parse --verify S. If they are the same, then S is an ancestor of HEAD.
    • To see if it’s a commit “done by someone else”, you need to compare the authors of the two commits, which you could do by comparing git show -s --pretty='%an <%ae>' HEAD and git show -s --pretty='%an <%ae>' S
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been wondering whether there is a good "git export" solution that creates a
I am wondering if there is an easy way, ie like a simple cron
I was wondering is there a way to prevent ' git push --force '
I have some C code which writes Ruby code into Git's post-commit hook. The
Is there a Git command equivalent to Subversion's: svnlook changed -r REVISION REPO I'm
This is a pretty simple question: as a Git newbie I was wondering if
I know there are lots of questions with this title but I could find
We are using mercurial-hg and git, and are wondering if there is a way
I've got multiple git repos under a directory, and I was wondering whether there
I'm fairly new to both Git and Ruby, but I'm wondering if this situation

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.