Checking out a project's first commit with git

Is there an easy way to find the SHA1 of the first commit in a project with a long history with git?

  • Can artists realistically cope with (distributed) version control in an open source environment?
  • What is the value-add of Repo (+git)?
  • Migrating away from Clearcase
  • How to move bugfixes across branches in DVCS?
  • NuGet and distributed version control (DVCS)
  • Manage home directory across multiple machines with some differences?
  • Grunt install fails on azure web app deploy through deploy.cmd file
  • Should “node_modules” folder be included in the git repository
  • Git “missing” commit
  • How to re-merge a branch, after a partial merge was performed
  • using git hook after commit
  • Git: what does the number of +/- signs in diff / merge output mean?
  • 2 Solutions collect form web for “Checking out a project's first commit with git”

    Just off the top of my HEAD, this should get one of the ‘first’ commits of the current branch.

    git rev-list --reverse HEAD | head -1

    (If the branch contiains two unrelated branches which have been merged together, it’s not guaranteed which root you will get but you could use --date-order to select the oldest.)

    git log --reverse | head -n1
    Git Baby is a git and github fan, let's start git clone.