Is there a way in Git to stage and commit files in one command? For example in my local repository I created files index.html, styles.css located in css folder and script.js located in js folder. Now I want to run one command to stage and commit all this files. I tried code below but it didn't work
git commit -a -m "my commit message"
git status
, possibly followed bygit diff <file>
and eventuallygit add
andgit commit
, it is easy to make sure that the commit is sane. If you just commit everything in your directory, you are eventually going to commit executables, generated PDFs, object files, scripts you didn't want to publish, private keys/passwords (yes, this actually happens!), files with private notes, etc. pp., the list goes on, and on, and on. Better safe than sorry.