Proposal: create meaningful aliases for git reset's hard/soft/mixed

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Proposal: create meaningful aliases for git reset's hard/soft/mixed

From: Philippe Vaucher <hidden>
Date: 2016-06-15 22:52:31

Hello,

A lot of time when I want to use reset for smth else than "--hard" I
have to go and look the documentation.
I think the modes could be improved by creating new aliases like this:

Optional: a new mode would be introduced for consistency:
--worktree (or maybe --tree): only updates the worktree but not the index

Then the existing mode could be aliased like this:
--mixed would be aliased as --index
--hard would be aliased as --all
--soft could be aliased as --no-changes

Additionally:
--merge could be removed in favor of an additional --preserve-staged flag
--keep could be removed in favor of an additional --safe flag

So if I recap my ideas:

"I want to discard my changes" --> git reset --all HEAD^
"I want to discard the last commit" --> git reset --index HEAD^
"I want to discard the last commit, but let's be safe in case I forgot
about a modified file" --> git reset --all --safe HEAD^
"I want to discard the last commit, keep my current staged changes"
--> git reset --all --preserve-staged HEAD^

Philippe

Re: Proposal: create meaningful aliases for git reset's hard/soft/mixed

From: Nguyen Thai Ngoc Duy <hidden>
Date: 2016-06-15 22:52:31

On Wed, Nov 23, 2011 at 3:28 PM, Philippe Vaucher
[off-list ref] wrote:
Hello,

A lot of time when I want to use reset for smth else than "--hard" I
have to go and look the documentation.
May be related: http://thread.gmane.org/gmane.comp.version-control.git/170266
-- 
Duy
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help