Skip to content

📝 Some common git configs / hooks / templates that I use

License

Notifications You must be signed in to change notification settings

grdryn/gitconfig

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

17 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

gitconfig

📝 Some common git configs / hooks / templates that I use

Global config

The .gitconfig file is intended to be (at least part of) a user’s global ~/.gitconfig.

Commit message template

The .git-commit-template is also expected to live in the user’s home directory. If you wish to change its name or location on your own system, you’ll just need to update the commit.template property in the global template. In essence, here.

The main purpose of the commit message template is to make it easier for me to use gitmoji with my current tooling, rather than installing gitmoji-cli (which is also cool if you want to use that).

When I’m committing with magit (emacs 💖), and I’m presented with the template, I’ll just uncomment the most relevant emoji summary line, and modify the message to be specific to my commit. I imagine it should work similarly with whatever tools you use.

.git_template directory

The .git_template/ directory should be symlinked/copied into your home directory. This will be used to populate any new repos with the hooks/ directory, which has the hooks listed below.

If you’d rather not use this, then remove the [init] section from the .gitconfig.

This might be a good place to start if you want more information about having a template directory: https://git-scm.com/docs/git-init

prepare-commit-msg hook

There are a couple of things that it does currently:

  1. If it’s a merge commit, it will prefix the summary line with 🔀, because emoji are the future, and this is the one that gitmoji prescribes for merging branches. 😎

  2. If GitPython is installed, and the current branch name starts with either AEROGEAR- or AGMS- or 'INTLY-', then it will uncomment the JIRA_PLACEHOLDER line in the commit message template, and insert a link to the issue on issues.jboss.org.

Contributing

You want to make this even more awesome? That’s great! You can open a PR on Github (or any other repo hosting site that you may find this hosted), or email changes to me. Consider including a relevant gitmoji in the commit message!

If you fork and make your own custom changes but don’t want to bother proposing those changes back to the original repo (https://github.com/grdryn/gitconfig), that’s cool too; just consider sending me a link anyway so that I can see what cool things you’re doing. 😉

About

📝 Some common git configs / hooks / templates that I use

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages