Re: Feature request: Allow extracting revisions into directories
- From
Michael J Gruber <git@drmicha.warpmail.net>
- Date
- Feb 4, 2013, 11:18 UTC
- Message-ID
- <510F9907.7010107@drmicha.warpmail.net>
- In-Reply-To
- <1359901085.24730.11.camel@t520>
Robert Clausecker venit, vidit, dixit 03.02.2013 15:18:
Show 18 quoted lines
> Hello! > > git currently has the archive command that allows to save an arbitrary > revision into a tar or zip file. Sometimes it is useful to not save this > revision into an archive but to directly put all files into an arbitrary > directory. Currently this seems to be not possible to archive directly; > the only way I found to do it is to run git archive and then directly > unpack the archive into a directory. > > git --git-dir REPO archive REVISION | tar x > > It would be nice to have a command or simply a switch to git archive > that allows the user to put the files of REVISION into a directory > instead of making an archive. > > Thank you very much for your help. Yours, > > Robert Clausecker
Sitaram has said much about the Unix philosophy already, and Konstantin gave a variant of checkout. Just two more cents:
How would you copy a directory tree? I presume you wouldn't use "tar c . | tar -xC gothere", but what would be your worklflow?
Depending on what you actually want to achieve, "git clone -b branch" and removing the superfluous .git-dir might be a viable option. (Beware the hardlinks, though.)
Michael