git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
* Proposal: create meaningful aliases for git reset's hard/soft/mixed
@ 2011-11-23  8:28 Philippe Vaucher
  2011-11-23  8:49 ` Matthieu Moy
                   ` (2 more replies)
  0 siblings, 3 replies; 22+ messages in thread
From: Philippe Vaucher @ 2011-11-23  8:28 UTC (permalink / raw)
  To: git

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

^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2012-12-18 16:31 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-23  8:28 Proposal: create meaningful aliases for git reset's hard/soft/mixed Philippe Vaucher
2011-11-23  8:49 ` Matthieu Moy
2011-11-23 11:32   ` Philippe Vaucher
2012-12-18  6:24   ` Martin von Zweigbergk
2011-11-23 12:02 ` Nguyen Thai Ngoc Duy
2011-11-23 18:51 ` Junio C Hamano
2011-11-23 23:00   ` Philippe Vaucher
2011-12-01 21:23     ` Phil Hord
2011-12-02  7:26       ` Thomas Rast
2011-12-02  7:45         ` Miles Bader
2011-12-02 15:28         ` Phil Hord
2011-12-02 14:27       ` Philippe Vaucher
2011-12-02 15:38         ` Phil Hord
2011-12-06  7:34           ` Philippe Vaucher
2012-10-03 16:23             ` Phil Hord
2012-10-03 18:41               ` Junio C Hamano
2012-10-03 19:03                 ` Junio C Hamano
2012-12-15 18:57                   ` Jan Engelhardt
2011-12-01 21:02   ` Phil Hord
2012-12-18  6:34   ` Martin von Zweigbergk
2012-12-18 15:22     ` Junio C Hamano
2012-12-18 16:30     ` Jeff King

Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).