GIT: Checkout to a "Really" Specific Folder
- by Rafid K. Abdullah
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