tags:

views:

80

answers:

3

I did:

git add -A

so that all my updates would be ready for commit, but for some reason it says that I have to manually do a git rm for each file that was deleted before I can commit the changes.

why is that, I thought git add -A did everything in terms of adding any new files, deleting old ones, etc. (getting them ready for commit)?

+2  A: 

Did you run the command in the root of the repository?

alexandrul
A: 

These files you can commit using git commit -a. See git-commit documentation.

Marcin Gil
+4  A: 

Looking at the title of your question, I see that git says that ../../file.name needs to be git-deleted. So it seems that you did the git add in a directory two levels below the one that holds file.name. However, this won't work. git add works on the current directory and directories below that one, not in directories higher up in the hierarchy. Unless you specify a path, of course.

Update:

This is documented, although the hint is a bit hidden. From man git-add:

A, --all

Update files that git already knows about (same as --update) and add all untracked files that are not ignored by .gitignore mechanism.

and

-u, --update

Update only files that git already knows about, staging modified content for commit and marking deleted files for removal. This is similar to what "git commit -a" does in preparation for making a commit, except that the update is limited to paths specified on the command line. If no paths are specified, all tracked files in the current directory and its subdirectories are updated.

innaM
ah ok, I am not 100% i was in the parent path but that sounds like it was the case.
mrblah