What’s the difference between:
git add .git commit -a
Should I be doing both, or is that redundant?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
git commit -ameans almost[*] the same thing asgit add -u && git commit.It’s not the same as
git add .as this would add untracked files that aren’t being ignored,git add -uonly stages changes (including deletions) to already tracked files.[*] There’s a subtle difference if you’re not at the root directory of your repository.
git add -ustages updates to files in the current directory and below, it’s equivalent togit add -u .whereasgit commit -astages and commits changes to all tracked files.