2

I have a local Git repository and all I want to do is copy all of the files from a particular revision to a folder outside of the working directory. I was assuming that it would just be a single command.

I'm probably missing something obvious, but I can't for the life of me work it out.

Thanks, LJ

LaughingJohn
  • 114
  • 4
  • 2
    You can use [git archive](http://stackoverflow.com/questions/160608/). – CB Bailey Mar 08 '12 at 17:21
  • Thanks Charles, that was very quick and very easy. Much appreciated. I don't use SO very much but if I can work out how to I'll mark your response as the answer! – LaughingJohn Mar 08 '12 at 17:25
  • @CharlesBailey. Charles I can't seem to mark a comment as the correct answer, so if you add an answer I'll happily mark it for you. – LaughingJohn Mar 09 '12 at 17:06

1 Answers1

1

Simplest way:

GIT_WORK_TREE=../other/path git checkout -f <hash> -- *
manojlds
  • 290,304
  • 63
  • 469
  • 417