git - How to shallow clone a specific commit with depth 1? -
is possible shallow clone specific commit in repository, i.e. depth 1? like
git clone http://myrepo.git 728a4d --depth 1 to repository state @ commit sha 728a4d...?
the motivation avoid having clone whole repository, check out specific commit, when we're interested in state of repository @ specific commit.
starting git 2.5.0 (which needs available @ both client , server side) can set uploadpack.allowreachablesha1inwant=true on server side enable fetching of specific sha1s:
git init git remote add origin <url> git fetch --depth 1 origin <sha1> git checkout fetch_head note did not find syntax git clone directly.
Comments
Post a Comment