The command git add [--all|-A]
appears to be identical to git add .
. Is this correct? If not, how do they differ?
views:
4710answers:
3@Ian Kelling, then delete it if you so wish.
Simucal
2009-02-27 06:52:47
@Charles Thanks for this detailed answer. I have edited your post adding sample output and summary.
takeshin
2010-09-04 07:02:02
@takeshin: I already had a one-line summary as the first paragraph and then a summary paragraph on what each form does. What does (for example) "without deleted" add? It's so brief that it could be interpreted as "without changes that delete lines" which isn't very clear. I had a script that the user could work through to try out the various combinations. You've intermingled commands to run and output to expect in the the same box which I think is more confusing than what I originally had. You've also only supplied the output to some commands. Was my answer really so bad before?
Charles Bailey
2010-09-04 10:42:38
@Charles The answer was excellent. I just had to run the code to see the output, so I thought that other may save some time seeing the output without running the code. I added the summary for the output above, which uses keywords: `deleted`, `new` and `modified` to be clear. No offence. Feel free to roll back the changes :)
takeshin
2010-09-04 16:04:48
A:
So from Charles instructions above, after testing my proposed understanding would be as follow:
For the next commit,
$ git add . # add to index only files created or modified and not those deleted
$ git add -u # add to index only files modified or deleted and not those created
$ git add -A # do both operation at once, add to index all files
This link might also be helpfull to understand in what situation those commands may be applied: http://www.geekgumbo.com/2010/05/16/removing-deleted-files-from-your-git-working-directory/
Richard
2010-06-01 09:27:35