what is the difference between git add and commit?
Git add adds files to the Git index, which is a staging area for objects prepared to be committed. Add tells git to start tracking a file. ... Git commit commits the files in the index to the repository, git commit -a is a shortcut to add all the modified tracked files to the index first.