Here are the commands I used with git version 2.1.2 to clone a local repo (ie. The following solution achieves what the OP and many others are looking for, which is a way to create a copy of a repository, including history, but only up to a certain commit. Well, its 2014 and it looks like Charles Bailey's accepted answer from 2010 is well and truly outdated by now and most (all?) of the other answers involve cloning, which many people are hoping to avoid. You can delete the tag from the original repo later to clean up. TL DR - Just create a tag in the source repository against the commit you want to clone up to and use the tag in the fetch command. # reset this repository's master branch to the commit of interest See this answer on Stackexchange for a exmple of how to activate the configuration option. Bitbucket Server enabled it since version 5.5+. ![]() Note that some Git servers activate this option by default, e.g. ![]() UPDATE 2 Since Git 2.5.0 the feature described below can be enabled on server side with configuration variable uploadpack.allowReachableSHA1InWant, here the GitHub feature request and the GitHub commit enabling this feature.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |