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
MBMark Burton <markb@ordern.com>
Date
Nov 19, 2008, 09:54 UTC
Message-ID
<20081119095452.3018d2de@crow>
In-Reply-To
<alpine.DEB.1.00.0811190206170.30769@pacific.mpi-cbg.de>
Hi,
Show 7 quoted lines
> It may be a traditional wart, but a helpful one.  Remember, you can also 
> say:
> 
> 	git commit that/directory/
> 
> I do _not_ want Git to add all untracked (and unignored) files in that 
> directory automatically.

Yes, I can see the wisdom in not automatically adding the contents of a directory specified on the command line. So that's probably the answer to my original question.

As for "knowing what the staging area is about", I use the staging area almost all the time as I consider it one of git's major improvements over "traditional" SCM systems. I especially like how I can use tools like git gui to browse and select the changes to be staged for the next commit.

Having said that, I still like the concept of being able to add named files without touching the index.

Feature request for the git gui people:
  It would be nice if git gui was able to stage a highlighted region
  rather than either the whole hunk or just the line under the cursor
  as I believe it behaves now. I might be wrong but I don't think it
  can do that at the moment. I think that would be useful because
  although it's a step forward to be able to stage individual lines in
  a hunk, it can be laborious if you want to pick out more than just a
  couple of lines.
Cheers,
Mark
Previous: Junio C HamanoNext: Johannes Schindelin
Message 11 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.