Is it possible to clone only certain commit from a git repo with depth 1?

pip package manager allows installing from various VCS including git:

Pip currently supports cloning over git, git+http and git+ssh:

  • Ignore local changes in the file and update it on pull
  • Sparse checkout and shallow clone
  • Set static variable from Gradle on build-time
  • git diff two files on same branch, same commit
  • How would you store encrypted information in public DVCS repository?
  • Elastic Beanstack - Rails - git deploy and deploy hooks
  • -e git://
    -e git+
    -e git+ssh://

    Passing branch names, a commit hash or a tag name is also possible:

    -e git://
    -e git://
    -e git://

    This is nice when the package is small, however, it becomes quite slow when the package is huge (e.g. Django). If I need just the last commit of master branch, then I could use --depth 1 parameter for git clone.

    Is it possible to get only a certain commit without the full repo history in general? At least from github?

  • Migration from SVN to GIT, suggest, please, repository structure
  • git and django migrations: ignore the migrations files
  • Git error: “Please make sure you have the correct access rights and the repository exists”
  • In Git, how do I configure a hook to run a server-side commands after a commit is accepted?
  • Can TortoiseMerge be used as a difftool with Windows Git Bash?
  • Sharing files across branches in Git
  • 3 Solutions collect form web for “Is it possible to clone only certain commit from a git repo with depth 1?”

    You can neither clone nor fetch from remote a particular commit, much less a depth of 1, due to security reasons:

    To the best of my knowledge, no. You may want to ask about this on the git mailing list.

    You can use GitHub API to get last/any commit:

    It’s not a git command, you’ll need to make a HTTP request, parse JSON response and download files with diff-data.

    Git Baby is a git and github fan, let's start git clone.