- Isolate different
git
configurations by like-workflows - Automatically associate work tasks to commits.
git checkout features/1234-banana
touch banana; git add banana
git commit -am "Banana"
git show --summary
commit 5d7070b96dd8fd3b1613c1c0c52bd22eb92aaa6a (HEAD -> features/1234-banana)
Author: Daryl Tucker <[email protected]>
Date: Fri Jul 16 16:20:00 1969 -0700
DevOps #1234: Banana
Assuming you create branches in features/
ie (git checkout -b features/1234-banana
), one of these commit-msg
scripts can be placed into .git/hooks/commit-msg
(+x
) of each/specific repository directories, however, if you have a setup similar to the following...
~/Projects/
├── WorkflowA
│ ├── repo1
│ └── repo2
└── WorkflowB
├── repo3
└── repo4
... then you can set up a group-specific .gitconfig
by sourcing it in your user ~/.gitconfig
, and those group-specific configs can reference different git
hook scripts:
~/.gitconfig <---
~/Projects/
├── WorkflowA
│ ├── repo1
│ └── repo2
└── WorkflowB
├── .gitconfig <---
├── .githooks
│ └── commit-msg <---
├── repo3
└── repo4
[user]
name = Daryl Tucker
email = [email protected]
[core]
hooksPath = "~/Projects/WorkflowB/.githooks"
[user]
name = Daryl Tucker
email = [email protected]
[includeIf "gitdir:~/Projects/WorkflowB/**"]
path = "~/Projects/WorkflowB/.gitconfig"