commit-msg: 开发者编写完并确认commit message后触发,常用于校验提交说明是否标准 post-commit: 整个git commit完成后触发,常用于邮件通知、提醒 applypatch-msg: 执行git am命令时触发,常用于检查命令提取出来的提交信息是否符合特定格式 pre-applypatch:git am提取出补丁并应用于当前分支后,准备提交前触发,常用于执...
如果你需要通过电子邮件接收由git format-patch产生的补丁,这些钩子也许用得上。 第一个运行的钩子是applypatch-msg。 它接收单个参数:包含请求合并信息的临时文件的名字。 如果脚本返回非零值,Git 将放弃该补丁。 你可以用该脚本来确保提交信息符合格式,或直接用脚本修正格式错误。 下一个在git am运行期间被调用的...
Git patches are text files used to share code. Learn how to Git create patch and Git apply patch using the command line and GitKraken Client.
The same recommendations apply whether you are working on a Github commit, Gitlab commit, or your local git server. Follow these guidelines when writing good commit messages: Keep it short (less than 150 characters total) Committing fewer changes at a time can help with this ...
Don’t return an error for patches containing no diff. This includes empty patches and patches with commit text only. SUBMODULES If the patch contains any changes to submodules thengit applytreats these changes as follows. If--indexis specified (explicitly or implicitly), then the submodule co...
Don’t return an error for patches containing no diff. This includes empty patches and patches with commit text only. SUBMODULES If the patch contains any changes to submodules thengit applytreats these changes as follows. If--indexis specified (explicitly or implicitly), then the submodule co...
这一大串数字是commit id ,是一个SHA1计算出来的一个非常大的数字,用十六进制表示,用来唯一辨识每个版本Git中,用HEAD表示当前版本,上一个版本是HEAD^,上上个版本是HEAD^^,如果数量过多,可用HEAD^n表示,n表示一个数字。回退上一个版本:[root@LAPTOP-1UJN7PP7 git-learn]# git reset --hard HEAD^ HEAD ...
│ ├── commit-msg.sample │ ├── post-update.sample │ ├── pre-applypatch.sample │ ├── pre-commit.sample │ ├── pre-push.sample │ ├── pre-rebase.sample │ ├── pre-receive.sample │ ├── prepare-commit-msg.sample ...
post-applypatch pre-commit prepare-commit-msg commit-msg post-commit pre-rebase post-checkout post-merge pre-receive update post-receive post-update pre-auto-gc post-rewrite pre-push使用Git 挂钩的实际用例由于Git 挂钩在调用它们的特定事件类型上执行脚本,你可以使用 Git 挂钩执行许多操作。以下...