Yes - good point. - "git add -A" is a better way before "git commit -am" to ensure all newly removed and added files are ready for the commit. On 6/28/2017 2:23 PM, Ken Moffat wrote:
On Wed, Jun 28, 2017 at 11:57:46AM +1200, Mark Schafer wrote:
5. To commit changes (record them for later use) - ```git commit -am "the message"``` - This combined command commits all changes (including new files and deletions) as well as any content changes and - adds a commit message.
If you created a new file but have not yet added it, git commit -a will not commit it. Personally I try to remember to use your next command -
6. Check status of local branch - Type ```git status``` - This shows you what the system thinks you intended to do and is generally useful to see what's up. - Use it often to see what the git system understands. - You can also use "git lg" (if you added it as described below) to see what is (and is not) around. But when I do commit something without adding a file, if that commit is still HEAD and has NOT been pushed, I can run
git add some-new-file
and then
git commit --amend
Similarly, I can also use
git commit --amend
immediately after committing if/when I make (and notice) a typo in the commit message.
ĸen