Answers for "git clone specific commit"

0

git clone specific commit

# 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
Posted by: Guest on July-08-2021
0

git clone specific version

#For cloning a specific version of a repo branch find the SHA1 ID and use
#following commands instruction
git clone $URL
cd $PROJECT_NAME
git reset --hard $SHA1
git pull
Posted by: Guest on November-26-2020

Code answers related to "Shell/Bash"

Browse Popular Code Answers by Language