Reputation: 14548
I'm loosing too much work working on both svn and git repositories at work. And i'm not the only one: Get back the changes after accidental checkout?
I wanted to rename/overload the checkout command with an alias.
basically, checkout
would just show me a diff of what i'm losing (or curse at myself, or run the sl
command :D )
and then i'd have the revert
to alias to do the real checkout command.
Is the first step possible? to alias something over the original command? or will checkout
always trigger the checkout command? I basically want to lock me out of checkout.
Bonus points if i can change the behaviour only when git checkout <file>
and not on git checkout <branch/tag/ref>
Upvotes: 2
Views: 177
Reputation: 1324268
The easiest way would be to make a wrapper for the command git itself (and reference that wrapper first in the PATH environment variable)
The wrapper could check:
Upvotes: 2