Few organization enables the pre-hook to commit any content to the repository. Whenever you forget to put the JIRA number in the commit message, you need to amend the commit.
Here are the Steps to resolve:-
1)Navigate to the repository directory location using the "Git
Bash"
2) Then do the rebase using "git rebase -i
"
3) It gives a page
showing your previous commits.
4) Click on "i
" on keyword to get
the edit mode .
5) Whichever commits you want to modify, change the word from
"pick to edit"
6) Click on Escape to stop editing. Then type ":wq!
"
to save and exit
7) Now its time to amend the commit one by one
using "git commit --amend
"
8) Edit the commit message , adding your
jira number.
9) Click on Escape to stop editing. Then type ":wq!
" to
save and exit
10) Repeat the 7,8,9 steps for the commits, you have
chosen edit instead of pick. No need to repeat, if you are editing only
one commit.
11) Once done for all, do "git rebase --continue
"
12)
Finally do "git push
"
# p, pick <commit> = use commit
# r, reword <commit> = use commit, but edit the commit message
# e, edit <commit> = use commit, but stop for amending
# s, squash <commit> = use commit, but meld into previous commit
# f, fixup <commit> = like "squash", but discard this commit's log message
# x, exec <command> = run command (the rest of the line) using shell
# d, drop <commit> = remove commit
# l, label <label> = label current HEAD with a name
# t, reset <label> = reset HEAD to a label