1

I found that most of the dev are using "git add --all" instead of "git add -u", Can you please help me out?

2

2 Answers 2

1

If you look at the docs you can see the differences

git add -u

Update the index just where it already has an entry matching <pathspec>. This removes as well as modifies index entries to match the working tree, but adds no new files.

If no <pathspec> is given when -u option is used, all tracked files in the entire working tree are updated (old versions of Git used to limit the update to the current directory and its subdirectories).

git add --all

Update the index not only where the working tree has a file matching but also where the index already has an entry. This adds, modifies, and removes index entries to match the working tree.

If no <pathspec> is given when -A option is used, all files in the entire working tree are updated (old versions of Git used to limit the update to the current directory and its subdirectories).

Sign up to request clarification or add additional context in comments.

3 Comments

Thanks for the details about "--all" and "-u" dippas
@LalitOnclick no problem :)
why is that link for? I have that link in my answer ! It is supposed to answer something about downvote?
0

git add -u add only tracked files

git add --all add tracked and untracked files

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.