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

Re: [PATCH 1/2] Documentation: 'git add -A' can remove files

From
Junio C Hamano <gitster@pobox.com>
Date
Dec 7, 2009, 07:34 UTC
Message-ID
<7vbpib9r10.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20091207005732.GA20909@atjola.homenet>
Björn Steinbrink <B.Steinbrink@gmx.de> writes:
Show 9 quoted lines
> What I usually say on #git is something like:
>
> 	"git add <path>" looks at the working tree to find files
> 	matching <path>.  "git add -u <path>" looks at the index, and
> 	"git add -A <path>" looks at both. Therefore "add" and "add -A"
> 	can add new files to the index, and "add -u" and "add -A" can
> 	remove files from it.
>
> 	And for convenience, -u and -A default to "." as the path argument.

Hmm, an interesting way of teaching. How effective is it with the real new to mid-level users we see on the #git channel?

Show 6 quoted lines
> So maybe something like this?
> ...
> -A, --all
>     Like -u, but matches <filepattern> against files in the index in
>     addition to the files in working tree. This means that it can find
>     new files as well.

Sounds easier to read to me but I think this description of "-A" seems backwards from your explanation. "Like -u" means "matches the index" and the difference is it in addition matches with the work tree, so it should probably be the other way around, i.e.

     Like -u, but matches <filepattern> against files in the work tree in
     addition to the index. This means that it can find new files as well.
Previous: Björn SteinbrinkNext: Björn Steinbrink
Message 4 of 6 in “Documentation: 'git add -A' can remove files”
  1. 1/2 Documentation: 'git add -A' can remove filesBjörn Gustavsson, Dec 6, 2009
  2. Junio C HamanoDec 6, 2009
  3. Björn SteinbrinkDec 7, 2009
  4. Junio C HamanoDec 7, 2009
  5. Björn SteinbrinkDec 7, 2009
  6. Junio C HamanoDec 7, 2009

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.