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

Re: way to automatically add untracked files?

From
Junio C Hamano <gitster@pobox.com>
Date
Aug 5, 2007, 05:04 UTC
Message-ID
<7vzm16h8qw.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<874pjelgyz.fsf@catnip.gol.com>
Miles Bader <miles@gnu.org> writes:
Show 6 quoted lines
> Anyway, I wouldn't be complaining except that I _keep_ running into
> circumstances where I need to type "git-add NEWFILE1 NEWFILE2
> NEWFILE3...; git rm OLD_FILE1..." -- which is kind of annoying after
> seeing a list of _exactly_ the files I need to add/remove output just
> previously by git-status.  Thus my wish to have git "do it
> automatically."

As Linus explained in another thread, "git rm" is largely unneeded. Just work with the filesystem in normal UNIX way, and be done with "git add -u" or even "git commit -a" and you will be fine.

If you are more perfect than most other people in maintaining the .gitignore file, you do not even have to name individual files like "git add NEWFILE1..." -- you can always safely run "git add .".

Most of us are not as perfect as you are, as you might have noticed that Randal pointed out this morning that we missed a new entry from our own .gitignore ;-) I highly suspect that we will be hated by most of our users if we changed "git add -u" to add everything in sight for this reason, and I also suspect they will feel that "git add-remove --all" will be code bloat for little gain.

Previous: Miles BaderNext: Miles Bader
Message 11 of 40 in “way to automatically add untracked files?”
  1. Miles BaderAug 5, 2007
  2. Shawn O. PearceAug 5, 2007
  3. Junio C HamanoAug 5, 2007
  4. Miles BaderAug 5, 2007
  5. Shawn O. PearceAug 5, 2007
  6. Miles BaderAug 5, 2007
  7. Junio C HamanoAug 5, 2007
  8. Miles BaderAug 5, 2007
  9. Junio C HamanoAug 5, 2007
  10. Miles BaderAug 5, 2007
  11. Junio C HamanoAug 5, 2007
  12. Miles BaderAug 5, 2007
  13. Johannes SchindelinAug 5, 2007
  14. Miles BaderAug 5, 2007
  15. Steffen ProhaskaAug 5, 2007
  16. Johan HerlandAug 5, 2007
  17. David KastrupAug 5, 2007
  18. Theodore TsoAug 5, 2007
  19. Johan HerlandAug 5, 2007
  20. Miles BaderAug 6, 2007
  21. Johannes SchindelinAug 6, 2007
  22. Miles BaderAug 6, 2007
  23. Johannes SchindelinAug 6, 2007
  24. Miles BaderAug 6, 2007
  25. Johan HerlandAug 6, 2007
  26. Johannes SchindelinAug 6, 2007
  27. Steffen ProhaskaAug 5, 2007
  28. Johannes SchindelinAug 6, 2007
  29. Steffen ProhaskaAug 6, 2007
  30. Jakub NarebskiAug 6, 2007
  31. Johan HerlandAug 6, 2007
  32. Junio C HamanoAug 6, 2007
  33. David KastrupAug 6, 2007
  34. Miles BaderAug 7, 2007
  35. Linus TorvaldsAug 5, 2007
  36. Junio C HamanoAug 5, 2007
  37. David KastrupAug 5, 2007
  38. Benchmarking git-add vs git-ls-files+update-index (was: way to automatically add untracked files?)David Kastrup, Aug 5, 2007
  39. Miles BaderAug 5, 2007
  40. Linus TorvaldsAug 5, 2007

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.