I have read the docs as well but could not get one thing.
Suppose I added new files to the repo.
Then which command do I need to execute first:
git add -A
or
git commit - m "test"
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.
You should first execute
git add .to stage the new/modified files and thengit commit -m "your message"to write those changes to the repository.You can see in here the different file statuses in git, and I strongly recommend you to read the whole book.
EDIT:
To make it clear, what you are doing with
git add .is basically telling git ‘Hey, I have new/modified/untracked files that I’d like to include in my next commit’, so that the next time you executegit committhose files changes are written to the repository.