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

Re: Git commit won't add an untracked file given on the command line

From
Miles Bader <miles@gnu.org>
Date
Nov 19, 2008, 03:43 UTC
Message-ID
<buomyfwmldj.fsf@dhapc248.dev.necel.com>
In-Reply-To
<alpine.DEB.1.00.0811190238360.30769@pacific.mpi-cbg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 5 quoted lines
>> I agree, but it would kinda handy to have an exception for files 
>> explicitly named on the command line.
>
> Only if you do not have a clear picture of what the staging area is about, 
> IMHO.
That's such a vague statement, I've not sure how to take it.

I use the staging area a lot, so I think I have a pretty clear idea of what it's "about", but I also often use "commit FILE" or "commit -a" for simple cases; even when splitting a change into multiple commits, it's often more convenient to do "commit FILE..." instead of "add FILE; commit".

I agree that having "commit DIR" add new files would likely be more annoying than helpful (it's not uncommon to have some temporary files laying around), but given that "commit FILE" is _explicitly_ naming the new file, it seems hard to imagine somebody would be surprised if it worked even when FILE was a new file...

-Miles
-- 
=====
(^o^;
(()))
*This is the cute octopus virus, please copy it into your sig so it can spread.
Previous: Johannes SchindelinNext: Johannes Schindelin
Message 7 of 22 in “Git commit won't add an untracked file given on the command line”
  1. Mark BurtonNov 18, 2008
  2. Francis GaliegueNov 18, 2008
  3. Mark BurtonNov 18, 2008
  4. Johannes SchindelinNov 19, 2008
  5. Miles BaderNov 19, 2008
  6. Johannes SchindelinNov 19, 2008
  7. Miles BaderNov 19, 2008
  8. Johannes SchindelinNov 19, 2008
  9. Miles BaderNov 20, 2008
  10. Junio C HamanoNov 19, 2008
  11. Mark BurtonNov 19, 2008
  12. Johannes SchindelinNov 19, 2008
  13. Junio C HamanoNov 19, 2008
  14. Mark BurtonNov 19, 2008
  15. Daniel BarkalowNov 19, 2008
  16. Junio C HamanoNov 19, 2008
  17. Mark BurtonNov 19, 2008
  18. Junio C HamanoNov 19, 2008
  19. Daniel BarkalowNov 19, 2008
  20. Junio C HamanoNov 20, 2008
  21. David AguilarNov 20, 2008
  22. Matthieu MoyNov 18, 2008

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.