git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
PVPhilippe Vaucher <philippe.vaucher@gmail.com>
Date
Dec 6, 2011, 07:34 UTC
Message-ID
<CAGK7Mr7+_n4opf=uQARxA7iSUMFNn9GCFGD5TrhCgarwGhEySA@mail.gmail.com>
In-Reply-To
<CABURp0pmnsgE1ywW-W2+QFNci=3Lm=JKj9Y3U8zjh8+Cg_NA6Q@mail.gmail.com>
> Think about why you need to use git-reset.  Why do new users need to
> use git-reset?  What is it they are after?

Ok, so let's forget about git reset and let's focus on the features instead. If I got it right you suggested the features that people wants most often are uncommit, unadd/undelete and undo. Here's a new proposal (based on your input):

uncommit: git jump <commit> (currently "git reset --soft <commit>") unadd/undelete: git unstage file (currently "git reset --mixed file" (with "git checkout file" for deleted files) undo: git checkout --force --clean <commit> (currently "git reset --hard <commit> && git clean -fd")

So, let's try out some scenarios:
1) Newbie user clones/pulls a repository from somewhere. He hacks
around and then things go bad, and he decides to scratch away
everything he did to make sure things are like they're supposed to be.
He'd then type "git checkout --force --clean master". If he didn't
introduce new files, he would simply type "git checkout --force
master"
2) Newbie adds some file to the index, then realise he added one too
many. He wants to remove it from being added. He'd then type "git
unstage file".
3) Average user creates a commit and suddenly realise he actually
wanted to split that commit in two (he cannot use --amend, and he's
not a rebase -i guru yet). Or he did a "temp" commit because he don't
know about "git stash" yet and wants to discard it. He wants to simply
go back to the previous state while keeping his changes in the index
and the worktree. He'd then type "git jump HEAD^1".
Feel free to add more scenarios!
Philippe
Previous: Phil HordNext: Phil Hord
Message 14 of 22 in “Proposal: create meaningful aliases for git reset's hard/soft/mixed”
  1. Philippe VaucherNov 23, 2011
  2. Matthieu MoyNov 23, 2011
  3. Philippe VaucherNov 23, 2011
  4. Martin von ZweigbergkDec 18, 2012
  5. Nguyen Thai Ngoc DuyNov 23, 2011
  6. Junio C HamanoNov 23, 2011
  7. Philippe VaucherNov 23, 2011
  8. Phil HordDec 1, 2011
  9. Thomas RastDec 2, 2011
  10. Miles BaderDec 2, 2011
  11. Phil HordDec 2, 2011
  12. Philippe VaucherDec 2, 2011
  13. Phil HordDec 2, 2011
  14. Philippe VaucherDec 6, 2011
  15. Phil HordOct 3, 2012
  16. Junio C HamanoOct 3, 2012
  17. Junio C HamanoOct 3, 2012
  18. Jan EngelhardtDec 15, 2012
  19. Phil HordDec 1, 2011
  20. Martin von ZweigbergkDec 18, 2012
  21. Junio C HamanoDec 18, 2012
  22. Jeff KingDec 18, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.