0

I am new to Git so please bear with me. I am trying to grab two different commits of a same project, specifically a current commit and an old commit with certain hash. I want them to clone it in separate folders (so that they don't overwrite and I can open them as separate projects at same time)? Is it possible?

Thanks in advance

NewUser07
  • 97
  • 1
  • 1
  • 6

1 Answers1

0

Normally a clone copies all of a repository's history, so you can just copy the repo and check out the other branch/commit in one of them. For example:

git clone ssh://someserver/repo
cp repo repo2
cd repo
git checkout HASH1
cd ../repo2
git checkout HASH2
Carl Norum
  • 219,201
  • 40
  • 422
  • 469
  • I'd recommend cloning repo to repo2 (`git clone repo repo2`), so that git can hard-link all the pack files. – torek Oct 01 '13 at 20:40