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
Phil Hord <phil.hord@gmail.com>
Date
Dec 2, 2011, 15:28 UTC
Message-ID
<CABURp0qcHaoi58EQ1FLGo2atPuWfS5x4p_SK7ZA_AqV7as212w@mail.gmail.com>
In-Reply-To
<201112020826.14114.trast@student.ethz.ch>
On Fri, Dec 2, 2011 at 2:26 AM, Thomas Rast <trast@student.ethz.ch> wrote:
Show 15 quoted lines
> Phil Hord wrote:
>>
>> Think outside the "reset" command.  Like this:
>>
>> From the "most popular" comment on http://progit.org/2011/07/11/reset.html:
>> > I remember them as:
>> > --soft      -> git uncommit
>> > --mixed  -> git unadd
>> > --hard     -> git undo
>>
>> I don't particular like these names, but conceptually they are helpful.
>
> I think all of these, but the last one in particular, are *very*
> dangerous oversimplifications.  Doubly so if you then use "undo" with
> a revision argument.
I agree.  That's why I also said this:
> How about:
>  --soft: git checkout -B <commit>
>  --mixed: git reset -- <paths>
>  --hard:  git checkout --clean

But maybe I wasn't clear enough. I'm not suggesting git-alias for these. I am proposing new commands to replace common usages of git-reset. These commands would need basic safeguards against foot-shooting, of course.

Phil
Previous: Miles BaderNext: Philippe Vaucher
Message 11 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.