Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR SHELL

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
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #git #clone #specific #commit
ADD COMMENT
Topic
Name
8+1 =