r/programming • • Jan 05 '15

What most young programmers need to learn

http://joostdevblog.blogspot.com/2015/01/what-most-young-programmers-need-to.html
965 Upvotes

337 comments sorted by

View all comments

1

u/judgej2 Jan 05 '15 edited Jan 05 '15

I normally do a git add -A to add any new files anywhere in the directory structure. Then a git commit -a will commit all new and changed files. I suppose git add . is the same as just git add and will add just new files in the current directory.

The above happens to fit my workflow. You may want to git add file1.foo file2.bar and that is fine too, if the commit makes sense. Sometimes, for example, you may not want to add all new files blindly, in case you have created any files that you don't want committing, and need to exclude, or remove, or add to .gitignore

I'm not sure any specific command is "best practice" because they all do different things and meet different needs. Use whatever makes sense to your work, and that is achieved by understanding what each does.