I’m new to git so forgive me if this is a dumb question.
I have a git repository and I need to copy a particular revision of the repository to its own separate directory. The copied version doesn’t need to be a git repository itself, I don’t need or want the history or the .git folder, just what the repository looked like for a particular commit.
So say I do this:
mkdir blah
cd blah
git init
touch flim0
git add .
git commit -a -m "First commit"
touch flim1
git add .
git commit -a -m "Second commit"
mystery-command ~/some-folder 4be82b42cc91ac3801ad72036cec5f88b6a13bd7
Where 4be82b42cc91ac3801ad72036cec5f88b6a13bd7 is the hash of “First commit”, I want ~/some-folder to be a directory that contains only the file flim0.
Is this easy/possible without having to clone the repository then checkout a particular revision then delete .git from the cloned repository?
replace master by a commit identifier
If you want to immediately ‘check it out’, consider
git archive(as usual) comes with a load of other useful options