2

I have a git repository on my machine, and at the moment it is only for this machine and myself to trace different versions of development.

I have been using basically git console commands, and tig to visualize different commits.

I just want to know what is the simplest way to check out a version, to another working folder on my machine...

Jigar
  • 129
  • 5
SoftTimur
  • 5,630
  • 38
  • 140
  • 292

2 Answers2

1

»[…] check out a version, to another working folder« suggests that you are looking for the git clone command:

git clone /path/to/your/repo /new/repo
cd /new/repo
git checkout <branch/tag/sha1>
knittl
  • 246,190
  • 53
  • 318
  • 364
0

You can use git checkout-index if you want to export only the files.

  1. If your working directory is "dirty", stash away your changes with git stash

  2. Checkout the version you want with git checkout <version>

  3. Export to desired directory with git checkout-index -a -f --prefix=/destination/path/

  4. Go back to where you were with git checkout HEAD@{1}

  5. Pop your changes back off with git stash pop

If your working directory is clean you can omit steps 1 and 5.

Here is SO answer with some more details.

Community
  • 1
  • 1
Andy
  • 44,610
  • 13
  • 70
  • 69