So true: http://xkcd.com/1597/
Great post on How to Write a Git Commit Message. Summary:
- Separate subject from body with a blank line
- Limit the subject line to 50 characters
- Capitalize the subject line
- Do not end the subject line with a period
- Use the imperative mood in the subject line
- Wrap the body at 72 characters
- Use the body to explain what and why vs. how
Since I’m committed to git (new motto “If it’s not in git, it does not exist”), I should learn to do it well.
AWS Code Commit qualifies as useful foo. 50Gb, 5 users, 10000 commits in free tier. No competition with github for collabortive features but, as it uses IAM for authentication it provides a good alterantive to bare repos on local host or shared hosting for those things you want in git, offsite, but do not want in public github repos.
Every file save can now be a git commit+push. Backups are now irrelevant (at least for emacs git users). And you thought VMS file version numbers were pretty neat…
This makes every file save do a git commit, optionally prompt for a commit message and optionally do a push.
I’m sure there are similar hacks for the non-emacs users out there…
Install the package (
M-x package-install git-auto-commit-mode) etc.
Add to your favorite
init.el or friend:
(add-hook 'certain-hook 'git-auto-commit-mode)
Decide how daring and/or annoyed you want to be. To go all-in and always ask for summary and push do the following:
(setq gac-automatically-push-p t) ;(setq gac-ask-for-summary-p t)
Per Directory configuration
To do things on a directory level, put something like this
((nil . ((eval git-auto-commit-mode 1))))
in a file called
.dir-locals.el in a directory you want to hae pushed. See http://www.gnu.org/software/emacs/manual/html_node/emacs/Directory-Variables.html
You can also specify per file variables http://www.gnu.org/software/emacs/manual/html_node/emacs/Specifying-File-Variables.html#Specifying-File-Variables if you choose.