xxxxxxxxxx
git clone --single-branch --branch <commit> <repository_url>
xxxxxxxxxx
# make a new blank repository in the current directory
git init
# add a remote
git remote add origin url://to/source/repository
# fetch a commit (or branch or tag) of interest
# Note: the full history up to this commit will be retrieved unless
# you limit it with '--depth=...' or '--shallow-since=...'
git fetch origin <sha1-of-commit-of-interest>
# reset this repository's master branch to the commit of interest
git reset --hard FETCH_HEAD
xxxxxxxxxx
# This will set the HEAD of your master to point to commit_sha.
git clone -n <repo_name>
git checkout <commit_sha>
xxxxxxxxxx
bash
git clone [URLTORepository]
git checkout [commithash]
commit hash looks like this "45ef55ac20ce2389c9180658fdba35f4a663d204"
xxxxxxxxxx
git clone <repository_url> // Clone the Git repository to your local machine
cd <repository_directory> // Change to the repository directory
git log // View the commit history and find the specific commit you want to clone
git branch new-branch // Create a new branch (replace new-branch with the desired branch name)
git checkout new-branch // Switch to the newly created branch
git reset --hard <commit_id> // Replace <commit_id> with the specific commit hash of the commit you want to clone