login
Header Space

 
 

Re: way to automatically add untracked files?

Score:
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Miles Bader <miles@...>
Cc: <git@...>
Date: Sunday, August 5, 2007 - 1:03 am

On Sun, 5 Aug 2007, Miles Bader wrote:


Do "git status -a" to figure out the removed ones.

I actually think we should probably make "git add ." do it too, but it's 
not how we've done it historically ("git add ." really ends up just 
reading the working directory tree and addign all the files it sees: so by 
definition it doesn't do anything at all to files it does *not* see, ie 
the removed ones).


Well, it's just "behaviour". It's probably largely historical, in that 
"git add" used to be thought of as "adding new files", but obviously then 
it got extended to mean "stage old files for commit" too, but in that 
extension, the "remove old files" never came up.

But git certainly has the capability. "git commit -a" will notice all the 
files that went away and automatically remove them, so

	git add .
	git commit -a

will do what you want (except, as we found out last week, we've had a huge 
performance regression, so that's actually a really slow way to do it, and 
so it's actually faster to do

	git ls-files -o | git update-index --add --stdin
	git commit -a

instead (where the first one just adds the *new* files, and then obviously 
the "git commit -a" does the right thing for old files, whether deleted or 
modified)

		Linus
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
way to automatically add untracked files?, Miles Bader, (Sat Aug 4, 11:31 pm)
Re: way to automatically add untracked files?, Miles Bader, (Sun Aug 5, 12:00 am)
Re: way to automatically add untracked files?, Linus Torvalds, (Sun Aug 5, 1:03 am)
Re: way to automatically add untracked files?, Miles Bader, (Sun Aug 5, 3:34 am)
Re: way to automatically add untracked files?, Linus Torvalds, (Sun Aug 5, 1:04 pm)
Re: way to automatically add untracked files?, Junio C Hamano, (Sun Aug 5, 1:14 am)
Re: way to automatically add untracked files?, David Kastrup, (Sun Aug 5, 3:32 am)
Re: way to automatically add untracked files?, Shawn O. Pearce, (Sun Aug 5, 12:13 am)
Re: way to automatically add untracked files?, Junio C Hamano, (Mon Aug 6, 4:45 am)
Re: way to automatically add untracked files?, David Kastrup, (Mon Aug 6, 2:19 pm)
Re: way to automatically add untracked files?, Miles Bader, (Mon Aug 6, 8:08 pm)
Re: way to automatically add untracked files?, Johan Herland, (Sun Aug 5, 8:11 am)
Re: way to automatically add untracked files?, Theodore Tso, (Sun Aug 5, 12:11 pm)
Re: way to automatically add untracked files?, Johan Herland, (Sun Aug 5, 3:16 pm)
Re: way to automatically add untracked files?, Johannes Schindelin, (Sun Aug 5, 8:16 pm)
Re: way to automatically add untracked files?, Miles Bader, (Sun Aug 5, 11:09 pm)
Re: way to automatically add untracked files?, Johannes Schindelin, (Sun Aug 5, 11:21 pm)
Re: way to automatically add untracked files?, Johan Herland, (Mon Aug 6, 3:46 am)
Re: way to automatically add untracked files?, Johannes Schindelin, (Mon Aug 6, 8:17 am)
Re: way to automatically add untracked files?, Miles Bader, (Sun Aug 5, 11:45 pm)
Re: way to automatically add untracked files?, Miles Bader, (Sun Aug 5, 8:00 pm)
Re: way to automatically add untracked files?, Steffen Prohaska, (Sun Aug 5, 4:04 pm)
Re: way to automatically add untracked files?, Johannes Schindelin, (Sun Aug 5, 8:17 pm)
Re: way to automatically add untracked files?, Steffen Prohaska, (Mon Aug 6, 12:58 am)
Re: way to automatically add untracked files?, David Kastrup, (Sun Aug 5, 8:17 am)
Re: way to automatically add untracked files?, Miles Bader, (Sun Aug 5, 12:22 am)
Re: way to automatically add untracked files?, Junio C Hamano, (Sun Aug 5, 12:23 am)
Re: way to automatically add untracked files?, Miles Bader, (Sun Aug 5, 12:30 am)
Re: way to automatically add untracked files?, Junio C Hamano, (Sun Aug 5, 12:39 am)
Re: way to automatically add untracked files?, Steffen Prohaska, (Sun Aug 5, 7:22 am)
Re: way to automatically add untracked files?, Miles Bader, (Sun Aug 5, 12:53 am)
Re: way to automatically add untracked files?, Junio C Hamano, (Sun Aug 5, 1:04 am)
Re: way to automatically add untracked files?, Miles Bader, (Sun Aug 5, 1:17 am)
Re: way to automatically add untracked files?, Johannes Schindelin, (Sun Aug 5, 1:23 am)
Re: way to automatically add untracked files?, Miles Bader, (Sun Aug 5, 1:27 am)
Re: way to automatically add untracked files?, Shawn O. Pearce, (Sat Aug 4, 11:58 pm)
Re: way to automatically add untracked files?, Junio C Hamano, (Sun Aug 5, 12:13 am)
speck-geostationary