GIT: Checkout to a "Really" Specific Folder

Posted by Rafid K. Abdullah on Stack Overflow See other posts from Stack Overflow or by Rafid K. Abdullah
Published on 2010-12-22T08:25:18Z Indexed on 2010/12/22 8:54 UTC
Read the original article Hit count: 320

Filed under:
|
|

I want to export, checkout, or whatever you call it from the index, HEAD, or any other commit, to a specific folder, how is that possible? Similar questions have already been asked:

GIT: Checkout to a specific folder

How to do a "git export" (like "svn export")

But the problem with the proposed solution is that they preserve the relative path. So for example, if I use the mentioned method to check out the file nbapp/editblog.php to the folder temp, the file would be checked out in temp/nbapp/editblog.php!

Is there anyway to checkout to 'temp' directly?

Also, another important thing is to be able to check the HEAD or any other commit. The checkout-index (which allows using the --prefix option to checkout to a specific folder, while normal checkout doesn't allow) checks out only the index. What if I want to check out a file from a certain commit to a certain folder? A similar question has alread

© Stack Overflow or respective owner

Related posts about git

Related posts about checkout