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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T15:11:35+00:00 2026-05-30T15:11:35+00:00

I’m trying to verify each commit in a sequence, moving from the first to

  • 0

I’m trying to verify each commit in a sequence, moving from the first to the current tip. It’s not really a git bisect, I don’t expect any problems and the tip works. But I want to make sure each commit is self-contained and correct.

I can use HEAD^ to go back one from the tip but is there a “one forward from where I am” treeish? That is, if I have

o aaabbbccc (tip)
|
o abcdefabc
|
o fedcbafed
|
o abcdabcde
|
o deadbeefe (root)

I want to do:

git checkout deadbeefe
build and test
git checkout current+1
<up two, return>
<up two, return>

But I can’t figure out the treeish for “current+1”.

  • 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-30T15:11:37+00:00Added an answer on May 30, 2026 at 3:11 pm

    Git does not store links from parents to children; only links from children to parents. To find a commit’s children, you have to start at the childmost commits in your repository (branch tips, tags, HEAD, etc.) and walk up the chain of parents until you either reach a root node or find the commit in question.

    If your commit DAG is linear and tip is a reference to the childmost commit, you can do something like the following to find the child commit of revision deadbeefe:

    git rev-list deadbeefe..tip | tail -n 1
    

    This causes Git to start walking from tip until it reaches deadbeefe or the root and print out all the commits it comes across. The output is then piped to tail to select the last visited commit, which will be the child of deadbeefe if the commit history is linear.

    HEAD refers to the currently checked-out commit, so if you need the child of the current commit instead of deadbeefe, use HEAD. Commands that require a commit default to HEAD if unspecified, so you can do the following:

    git rev-list ..tip | tail -n 1
    

    Again, this only works if the DAG is linear. If the commit history is not linear, you can use the --ancestry-path argument to rev-list.

    Doing the above each time you want to move to the next commit would be O(n^2), but Git is so fast that it usually doesn’t matter in practice. If you need it to be O(n), I’d do the following:

    git rev-list --reverse tip | while IFS= read -r rev; do
        git checkout "${rev}" || handle_checkout_error_here
        # build and test here
    done
    

    And @knittl is correct—the term you want here is commit, not treeish. Some terminology:

    • A ‘treeish’ is something that can act like a file system tree (e.g., the index, your working directory, a subdirectory in your working directory, a commit, a subdirectory inside a commit, etc.).
    • ‘Revision’ is less well defined than commit, but it usually means the things that identify a commit (commits themselves, annotated tags that point to a commit, and references that refer to a commit).
    • A ‘reference’ is a pointer to a Git object or another reference (in which case it’s called a ‘symbolic reference’). A reference usually points to a commit or annotated tag object, but it can point to anything. People usually say reference when they want to generically refer to HEAD, tags, and/or branches.
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically, what I'm trying to create is a page of div tags, each has
I'm trying to decode HTML entries from here NYTimes.com and I cannot figure out
I am trying to understand how to use SyndicationItem to display feed which is
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am currently running into a problem where an element is coming back from
I'm parsing an RSS feed that has an &#8217; in it. SimpleXML turns this
We're building an app, our first using Rails 3, and we're having to build
I have a text area in my form which accepts all possible characters from
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.