很少有组织允许 pre-hook 将任何内容提交到存储库。每当您忘记将 JIRA 编号放入提交消息中时,您就需要修改提交。
以下是解决步骤:-
1)使用“Git”导航到存储库目录位置
猛击”
2)然后使用“进行变基”git rebase -i
"
3)它给出了一个页面
显示您之前的提交。
4)点击“i
" 关键字获取
编辑模式。
5)无论你想修改哪个提交,将单词从
“选择编辑”
6) 单击“Escape”停止编辑。然后输入“:wq!
”
保存并退出
7)现在是时候一一修改commit了
使用 ”git commit --amend
"
8) 编辑提交消息,添加您的
吉拉号码。
9) 单击“Escape”停止编辑。然后输入“:wq!
“ 到
保存并退出
10) 重复7,8,9步骤进行提交,你有
选择编辑而不是选择。如果您仅进行编辑,则无需重复
一次提交。
11)完成所有工作后,执行“git rebase --continue
"
12)
最后做到“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