Thread (4 messages) flat view 4 messages, 3 authors, 2016-06-15

Re: Add 'sane' mode to 'git reset'

From: Linus Torvalds <torvalds@linux-foundation.org>
Date: 2016-06-15 22:45:43


On Mon, 1 Dec 2008, Avery Pennarun wrote:
For reference, I advised someone just yesterday to use "git reset
HEAD^" to undo an accidental "commit -a" instead of just "commit".
Yeah, I guess the --mixed default of "git reset" is occasionally useful.
Also, as far as I know, "git reset HEAD filename" is the only
recommended way to undo an accidental "git add".
The path-name based ones are actually a totally different animal than the 
non-pathname version of "git reset". With pathnames, it won't change the 
actual HEAD, so it's really a totally different class of command, just 
sharing a name.

But:
How about calling it --merge instead?  That's really what it does:
merges the diffs from (your current index) to (the requested index)
into (your working tree and your index).
Sure, "git reset --merge" would probably be a fine form.

		Linus
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help