Add git checkout any file from any commit
As I understood current realisation gcf just resets file to the origin, it is not what I expected to see when I read the description.
I would like to see interactive git checkout any file version in any branch in any commit possibility.
And change current naming to something like git reset file instead of git checkout file. Let me know if I misunderstood something.
I confirm that the naming can be irritating and I had the same thought at first. However, that's how git checkout itself behaves, so forgit just took over that naming.
There is already a discussion concerning this going on here.
it is not what I expected to see when I read the description
Can you point me to where you read that description? I don't think we have any description of this function, do we?
@carlfriedrich Sorry for the misunderstanding – by “description” I meant gcf - Interactive git checkout <file> selector line from the readme, that is just how I understood it. There is no problem with the naming; it would just be great to add one more interactive step to select a commit instead of automatically using HEAD from origin.
and git reset HEAD -- path/to/file if I remember do the same. but again naming is no problem. problem that this command will be really useful if it allow select any version of the file instead of the last one. the origin version I could manually view in the diff view, via discarding or stashing the dirty file, and I just remember it. not very useful command if it limits me only to origin/head version. Nobody checkout head version of file, they just discard current changes in this file
@AuthorProxy Okay, thanks for the clarification. This is a valid feature request then. I will leave the issue open and have tagged it accordingly.
I like this idea. Wondering whether or not this should be implemented as a separate command. I like the possibility to checkout a file from HEAD with a simple gcf and implementing this as a separate command would ensure we don't change the current functionality. Internally forgit_checkout could be modified to simply run forgit_checkout_from HEAD (or whatever we name the new function). WDYT @carlfriedrich?
I had the same thought already. I would also prefer implementing this in a dedicated command.