Can I checkout a single file without altering index?
- From
Christian Halstrick <christian.halstrick@gmail.com>
- Date
- Oct 12, 2010, 10:03 UTC
- Message-ID
- <loom.20101012T114900-532@post.gmane.org>
Can I checkout a certain file to a specific revision without also adding this content to the index? I only want to alter the working-tree - no modification of index or HEAD needed.
Here is why I need that: I see a bug in git controlled sources. I fix one source file and also add one unit test in a separate file. I checked that the test succeeds with my fix. The index now contains what I want to commit. Now I want to see whether my test fails without my fix. I want to checkout HEAD for the source file without destroying my index. In the end, after I saw that my test fails without my fix, I just want to say "git commit" without having to.