Readme
This commit is contained in:
28
README.md
28
README.md
@ -1,5 +1,31 @@
|
|||||||
# git-hooks
|
# git-hooks
|
||||||
|
|
||||||
|
### How it works
|
||||||
|
|
||||||
|
Git hooks adds `prepare-commit-msg` hook which is executed before committing message.
|
||||||
|
|
||||||
|
Hook script will take current branch name and parse issue ticket name/number from it. If found, ticket will be prepend to commit message, and link to jira ticket will be added at the end.
|
||||||
|
|
||||||
|
For example, if current branch is `CLOUD-12345-some-important-branch` and we add commit:
|
||||||
|
|
||||||
|
```
|
||||||
|
git commit -m "some important message"
|
||||||
|
```
|
||||||
|
|
||||||
|
resulting commit message will be:
|
||||||
|
|
||||||
|
```
|
||||||
|
git log
|
||||||
|
commit 963dca96dd658a7df590c8b27b45d7f7536f9c1d (HEAD -> CLOUD-12345-some-important-branch)
|
||||||
|
Author: Eden Kirin <eden@ekirin.com>
|
||||||
|
Date: Fri Sep 1 09:57:54 2023 +0200
|
||||||
|
|
||||||
|
CLOUD-12345: some important message
|
||||||
|
|
||||||
|
https://smartvending.atlassian.net/browse/CLOUD-12345
|
||||||
|
|
||||||
|
```
|
||||||
|
|
||||||
## Installation
|
## Installation
|
||||||
|
|
||||||
1. Clone repository
|
1. Clone repository
|
||||||
@ -24,6 +50,6 @@ git clone https://gitea.ekirin.com/Intis/git-hooks.git
|
|||||||
git config --global init.templateDir '~/.git-templates'
|
git config --global init.templateDir '~/.git-templates'
|
||||||
```
|
```
|
||||||
|
|
||||||
3. Reinitialize existing git repos you wish to use this in: "git init"
|
3. Reinitialize existing git repos you wish to use this in with: `git init``
|
||||||
|
|
||||||
4. Rename `your-repo-dir/.git/intis-hooks` to `your-repo-dir/.git/hooks`
|
4. Rename `your-repo-dir/.git/intis-hooks` to `your-repo-dir/.git/hooks`
|
||||||
|
|||||||
Reference in New Issue
Block a user