0

I have a folder with local git repository. And I have a lot of comments, but no remote repository yet.

git log 

shows a lot of comments with commit hash values.

Now I need to get a copy of a particular comment and save the source files in another directory. What's the best way to do it? git checkout HASH will overwrite the current directory?

ca9163d9
  • 27,283
  • 64
  • 210
  • 413
  • https://stackoverflow.com/questions/160608/do-a-git-export-like-svn-export This might help – Rishabh Agarwal Sep 21 '18 at 16:16
  • Use `git archive` if you just want a raw tarball or zip file. Use `git worktree add` to add a work-tree with a detached HEAD or new branch pointing to that commit if you want to do actual work with it, and have a Git new enough to support `git worktree` (2.5 or later). Beware of various bugs in `git worktree` if you are going to work on this for a while; in this case, you might want a new clone. – torek Sep 21 '18 at 19:13

1 Answers1

0

git archive is your friend in this case

eftshift0
  • 26,375
  • 3
  • 36
  • 60