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

Re: Proposal: "unadd" command / alias.

From
Filipp Bakanov <filipp@bakanov.su>
Date
Oct 27, 2020, 22:02 UTC
Message-ID
<CAAdniQ4vx4z9KnfvG7thzxf1xBa=P_nnbY1G=RTFUBb4Zxqeaw@mail.gmail.com>
In-Reply-To
<20201027215638.GI5691@mit.edu>
>> Indeed, I have a similar alias in my ~/.gitconfig

Why not just add it to git by default for everybody? revert-file is also ok, anything except `checkout HEAD --` will be good.

On Wed, 28 Oct 2020 at 00:56, Theodore Y. Ts'o <tytso@mit.edu> wrote:
Show 40 quoted lines
>
> On Tue, Oct 27, 2020 at 01:32:50PM -0700, Junio C Hamano wrote:
> > Filipp Bakanov <filipp@bakanov.su> writes:
> >
> > > Hi! I suggest to add "unadd" command, that will undo a git add command.
> > >
> > > git unadd path/to/file
> > >
> > > It will be an alias to:
> > >
> > > git reset HEAD -- path/to/file
> > >
> > > The motivation is that I always forget syntax and have to google each
> > > time I want to undo accidentally added files. Unadd is just much
> > > easier to remember and quite obvious.
> >
> > The alias is for you to do the above, I think.
>
> Filipp,
>
> Indeed, I have a similar alias in my ~/.gitconfig
>
> [alias]
>         revert-file = checkout HEAD --
>
> Adding
>
> [alias]
>         unadd = reset HEAD --
>
> to your .gitconfig would do what you want.  As a BTW, my favorite
> alias is:
>
>    lgt = log --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr)%Creset' --abbrev-commit
>
> Sample usage: "git lgt origin.." or "git lgt -10".
>
> Cheers,
>
>                                         - Ted
Previous: Theodore Y. Ts'oNext: Theodore Y. Ts'o
Message 4 of 12 in “Proposal: "unadd" command / alias.”
  1. Filipp BakanovOct 27, 2020
  2. Junio C HamanoOct 27, 2020
  3. Theodore Y. Ts'oOct 27, 2020
  4. Filipp BakanovOct 27, 2020
  5. Theodore Y. Ts'oOct 27, 2020
  6. Filipp BakanovOct 27, 2020
  7. Philip OakleyOct 28, 2020
  8. Pratyush YadavOct 28, 2020
  9. Filipp BakanovOct 28, 2020
  10. Junio C HamanoOct 28, 2020
  11. Konstantin TokarevOct 28, 2020
  12. Filipp BakanovOct 28, 2020

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.