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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T23:57:16+00:00 2026-06-08T23:57:16+00:00

There are a number of git commands, such as git clone –depth 10 <repo>

  • 0

There are a number of git commands, such as git clone --depth 10 <repo>, that require the number of revisions [git help revisions] to be given.

What is the distinction between a commit and a revision (in git, rather than say svn)?

Or does it only show up in the plural when trying to count revisions/commits, e.g. that revisons must be counted by walking the DAG (directed acyclic graph) of commits and their parents, or some other careful distinction?

  • 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-06-08T23:57:18+00:00Added an answer on June 8, 2026 at 11:57 pm

    See “SPECIFYING REVISIONS” of git rev-parse:

    A revision parameter <rev> typically, but not necessarily, names a commit object.
    It uses what is called an extended SHA1 syntax, [and includes] various ways to spell object names.

    So “revision” refers to the id you can use as a parameter to reference an object in git (usually a commit).

    HEAD@{5 minutes ago} is a revision which reference the commit present 5 minutes ago.

    gitrevision mentions:

    […] some Git commands (such as git show) also take revision parameters which denote other objects than commits, e.g. blobs (“files”) or trees (“directories of files”).

    For instance, the following rev parameter doesn’t reference a commit:

    <rev>:<path>, e.g. HEAD:README, :README, master:./README
    

    A suffix : followed by a path names the blob or tree at the given path in the tree-ish object named by the part before the colon.


    A “commit” in Git generally designates a “commit object” (as described in git commit-tree for instance):

    A commit encapsulates:

    • all parent object ids
    • author name, email and date
    • committer name and email and the commit time.

    So:

    • a commit designates one of the git objects (others are blobs, tree, tags, notes),
    • a revision is a way to reference a git object.

    In your case (git clone) --depth <n> does:

    Create a shallow clone with a history truncated to the specified number of revisions.

    It is for all the commits accessible at that depth, up to n revisions per path in the DAG.
    Since the result can be more than n commits, the term revision is more adapted here in order to emphasize you don’t want just n commits, but any commits referenced by a max of n revisions accessible.

    However, in this context, revisions clearly reference only commits (as illustrated below) reachable (as you mentioned in “Is git clone --depth 1 (shallow clone) more useful than it makes out?“).

    The question is “reachable from what”?

    You referenced this thread which included:

    IIRC, --depth=<n> is not “deepen by <n>“, but “make sure I have at least <n> from the updated tip(s)“.
    The shallow-clone hack gives you quite useless (even though it may be internally consistent) semantics if you shallow-cloned way in the past and fetched with --depth after the other side added many more commits than <n>, as you cannot guess what the right
    value of <n> should be without actually fetching without --depth.

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

Sidebar

Related Questions

Is there a maximum number of email addresses that can be included in a
I have a script that is automating author re-writes on a number of git
Is there a maximum number of git stashes, or can you have as many
From the man page on git-merge, there are a number of merge strategies you
Is there a way to take an existing git repository and display the number
I have a large number of projects setup in Git that were previously managed
Is there any way to use git-svn to clone only some folders of an
There are a number of hosting services for git, Mercurial, etc. I need to
Using git I made something like this git clone git checkout {a rev number
I have moved an SVN repo to Git and probably due to a number

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.