159 lines
17 KiB
Plaintext
159 lines
17 KiB
Plaintext
|
||
[38;5;12m [39m
|
||
[38;5;12m Awesome Git Hooks[39m
|
||
|
||
|
||
|
||
[38;5;12m [39m
|
||
[38;5;12m [39m
|
||
|
||
|
||
[38;5;12m [39m[38;2;255;187;0m[1m[4mAwesome Git Hooks[0m
|
||
|
||
[38;5;11m[1m▐[0m[38;5;12m [39m[38;5;12m:anchor: Easy-to-use git hooks for automating tasks during git workflows.[39m
|
||
|
||
[38;5;12mGit[39m[38;5;12m [39m[38;5;12mhooks[39m[38;5;12m [39m[38;5;12mare[39m[38;5;12m [39m[38;5;12mcustom[39m[38;5;12m [39m[38;5;12mscripts[39m[38;5;12m [39m[38;5;12myou[39m[38;5;12m [39m[38;5;12mcan[39m[38;5;12m [39m[38;5;12muse[39m[38;5;12m [39m[38;5;12mto[39m[38;5;12m [39m[38;5;12mautomate[39m[38;5;12m [39m[38;5;12mtasks[39m[38;5;12m [39m[38;5;12mwhich[39m[38;5;12m [39m[38;5;12mare[39m[38;5;12m [39m[38;5;12mtriggered[39m[38;5;12m [39m[38;5;12mbefore[39m[38;5;12m [39m[38;5;12mor[39m[38;5;12m [39m[38;5;12mafter[39m[38;5;12m [39m[38;5;12ma[39m[38;5;12m [39m[38;5;12mgit[39m[38;5;12m [39m[38;5;12mcommand[39m[38;5;12m [39m[38;5;12mis[39m[38;5;12m [39m[38;5;12mexecuted.[39m[38;5;12m [39m[38;5;12mThere[39m[38;5;12m [39m[38;5;12mare[39m[38;5;12m [39m[38;5;12mtwo[39m[38;5;12m [39m[38;5;12mgroups[39m[38;5;12m [39m[38;5;12mof[39m[38;5;12m [39m[38;5;12mthese[39m[38;5;12m [39m[38;5;12mhooks:[39m[38;5;12m [39m[38;5;12mclient-side[39m[38;5;12m [39m[38;5;12mand[39m[38;5;12m [39m[38;5;12mserver-side.[39m[38;5;12m [39m[38;5;12mClient-side[39m[38;5;12m [39m[38;5;12mhooks[39m[38;5;12m [39m[38;5;12mare[39m[38;5;12m [39m[38;5;12mtriggered[39m[38;5;12m [39m[38;5;12mby[39m[38;5;12m [39m[38;5;12moperations[39m[38;5;12m [39m[38;5;12msuch[39m[38;5;12m [39m[38;5;12mas[39m[38;5;12m [39m
|
||
[38;5;12mcommitting[39m[38;5;12m [39m[38;5;12mand[39m[38;5;12m [39m[38;5;12mmerging,[39m[38;5;12m [39m[38;5;12mwhile[39m[38;5;12m [39m[38;5;12mserver-side[39m[38;5;12m [39m[38;5;12mhooks[39m[38;5;12m [39m[38;5;12mrun[39m[38;5;12m [39m[38;5;12mon[39m[38;5;12m [39m[38;5;12mnetwork[39m[38;5;12m [39m[38;5;12moperations[39m[38;5;12m [39m[38;5;12msuch[39m[38;5;12m [39m[38;5;12mas[39m[38;5;12m [39m[38;5;12mreceiving[39m[38;5;12m [39m[38;5;12mpushed[39m[38;5;12m [39m[38;5;12mcommits.[39m[38;5;12m [39m[38;5;12mThis[39m[38;5;12m [39m[38;5;12mrepo[39m[38;5;12m [39m[38;5;12mcontains[39m[38;5;12m [39m[38;5;12mhelpful[39m[38;5;12m [39m[38;5;12mresources[39m[38;5;12m [39m[38;5;12mas[39m[38;5;12m [39m[38;5;12mwell[39m[38;5;12m [39m[38;5;12mas[39m[38;5;12m [39m[38;5;12ma[39m[38;5;12m [39m[38;5;12mvariety[39m[38;5;12m [39m[38;5;12mof[39m[38;5;12m [39m[38;5;12mgit[39m[38;5;12m [39m[38;5;12mhook[39m[38;5;12m [39m[38;5;12mscripts[39m[38;5;12m [39m[38;5;12mthat[39m[38;5;12m [39m[38;5;12mcan[39m[38;5;12m [39m[38;5;12mbe[39m[38;5;12m [39m[38;5;12measily[39m[38;5;12m [39m[38;5;12mcustomized[39m[38;5;12m [39m[38;5;12mto[39m[38;5;12m [39m[38;5;12mserve[39m[38;5;12m [39m[38;5;12mdifferent[39m[38;5;12m [39m[38;5;12mpurposes.[39m
|
||
|
||
[38;5;12m:heavy_check_mark: Nothing to install/download[39m
|
||
|
||
[38;5;12m:heavy_check_mark: Code is well-documented[39m
|
||
|
||
[38;5;12m:heavy_check_mark: Grab & go! Copy the code you want to use and paste into your .git/hooks folder[39m
|
||
|
||
[38;5;12mContributions[39m[38;5;12m [39m[38;5;12mare[39m[38;5;12m [39m[38;5;12m_always_[39m[38;5;12m [39m[38;5;12mwelcome![39m[38;5;12m [39m[38;5;12mPlease[39m[38;5;12m [39m[38;5;12msee[39m[38;5;12m [39m[38;5;12mour[39m[38;5;12m [39m[38;5;14m[1mContribution[0m[38;5;14m[1m [0m[38;5;14m[1mGuidelines[0m[38;5;12m [39m[38;5;12m(CONTRIBUTING.md).[39m[38;5;12m [39m[38;5;12mAlso,[39m[38;5;12m [39m[38;5;12mif[39m[38;5;12m [39m[38;5;12myou[39m[38;5;12m [39m[38;5;12mdon't[39m[38;5;12m [39m[38;5;12mfind[39m[38;5;12m [39m[38;5;12mthe[39m[38;5;12m [39m[38;5;12mscript[39m[38;5;12m [39m[38;5;12myou[39m[38;5;12m [39m[38;5;12mwant[39m[38;5;12m [39m[38;5;12mbelow,[39m[38;5;12m [39m[38;5;12myou[39m[38;5;12m [39m[38;5;12mcan[39m[38;5;12m [39m[38;5;14m[1mcreate[0m[38;5;14m[1m [0m[38;5;14m[1ma[0m[38;5;14m[1m [0m[38;5;14m[1mnew[0m[38;5;14m[1m [0m[38;5;14m[1missue[0m[38;5;12m [39m
|
||
[38;5;12m(https://github.com/CompSciLauren/awesome-git-hooks/issues/new?assignees=&labels=enhancement&template=new-git-hook-script-request.md&title=)[39m[38;5;12m [39m[38;5;12mto[39m[38;5;12m [39m[38;5;12mrequest[39m[38;5;12m [39m[38;5;12mit.[39m
|
||
|
||
[38;2;255;187;0m[4mContents[0m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mGit Hook Scripts[0m[38;5;12m (#git-hook-scripts)[39m
|
||
[38;5;12m - [39m[38;5;14m[1mcommit-msg[0m[38;5;12m (#commit-msg)[39m
|
||
[38;5;12m - [39m[38;5;14m[1mpost-checkout[0m[38;5;12m (#post-checkout)[39m
|
||
[38;5;12m - [39m[38;5;14m[1mpost-update[0m[38;5;12m (#post-update)[39m
|
||
[38;5;12m - [39m[38;5;14m[1mpre-commit[0m[38;5;12m (#pre-commit)[39m
|
||
[38;5;12m - [39m[38;5;14m[1mprepare-commit-msg[0m[38;5;12m (#prepare-commit-msg)[39m
|
||
[38;5;12m - [39m[38;5;14m[1mpre-push[0m[38;5;12m (#pre-push)[39m
|
||
[38;5;12m - [39m[38;5;14m[1mpre-rebase[0m[38;5;12m (#pre-rebase)[39m
|
||
[38;5;12m - [39m[38;5;14m[1mquery-watchman[0m[38;5;12m (#query-watchman)[39m
|
||
[38;5;12m - [39m[38;5;14m[1mupdate[0m[38;5;12m (#update)[39m
|
||
[38;5;12m- [39m[38;5;14m[1mQuick Start[0m[38;5;12m (#quick-start)[39m
|
||
[38;5;12m- [39m[38;5;14m[1mTools[0m[38;5;12m (#tools)[39m
|
||
[38;5;12m- [39m[38;5;14m[1mWritten Guides[0m[38;5;12m (#written-guides)[39m
|
||
[38;5;12m- [39m[38;5;14m[1mVideo Guides[0m[38;5;12m (#video-guides)[39m
|
||
|
||
[38;2;255;187;0m[4mGit Hook Scripts[0m
|
||
|
||
[38;5;12mNote: The icon next to each script signifies what language it is written in.[39m
|
||
|
||
[38;5;239m│[39m[38;5;12micon[39m[38;5;239m│[39m[38;5;12mlanguage[39m[38;5;239m│[39m
|
||
[38;5;239m├[39m[38;5;239m────[39m[38;5;239m┼[39m[38;5;239m────────[39m[38;5;239m┤[39m
|
||
[38;5;239m│[39m[38;5;12m [39m[38;5;239m│[39m[48;5;235m[38;5;249mbash[49m[39m[38;5;12m [39m[38;5;239m│[39m
|
||
[38;5;239m│[39m[38;5;12m [39m[38;5;239m│[39m[48;5;235m[38;5;249mpython[49m[39m[38;5;12m [39m[38;5;239m│[39m
|
||
[38;5;239m│[39m[38;5;12m [39m[38;5;239m│[39m[48;5;235m[38;5;249mperl[49m[39m[38;5;12m [39m[38;5;239m│[39m
|
||
|
||
[38;2;255;187;0m[4mcommit-msg[0m
|
||
|
||
[38;5;12m-[39m[38;5;12m [39m[38;5;14m[1menforce-insert-issue-number[0m[38;5;12m [39m[38;5;12m(https://github.com/CompSciLauren/awesome-git-hooks/blob/master/commit-msg-hooks/enforce-insert-issue-number.hook)[39m[38;5;12m [39m[38;5;12m-[39m[38;5;12m [39m[38;5;12mMake[39m[38;5;12m [39m[38;5;12msure[39m[38;5;12m [39m[38;5;12muser[39m[38;5;12m [39m[38;5;12mdid[39m[38;5;12m [39m[38;5;12mnot[39m[38;5;12m [39m[38;5;12mdelete[39m[38;5;12m [39m[38;5;12mthe[39m[38;5;12m [39m[38;5;12mISSUE-[39m[38;5;12m*[39m[48;2;30;30;40m[38;5;13m[3m#[0m[48;2;30;30;40m[38;5;14m[1m[3m [0m[48;2;30;30;40m[38;5;14m[1m[3mstring[0m[48;2;30;30;40m[38;5;14m[1m[3m [0m[48;2;30;30;40m[38;5;14m[1m[3mthat[0m[48;2;30;30;40m[38;5;14m[1m[3m [0m[48;2;30;30;40m[38;5;14m[1m[3mwas[0m[48;2;30;30;40m[38;5;14m[1m[3m [0m[48;2;30;30;40m[38;5;14m[1m[3mgenerated[0m[48;2;30;30;40m[38;5;14m[1m[3m [0m[48;2;30;30;40m[38;5;14m[1m[3mby[0m[48;2;30;30;40m[38;5;14m[1m[3m [0m
|
||
[48;2;30;30;40m[38;5;14m[1m[3mprepare-commit-msg/insert-issue-number.hook.[0m[48;2;30;30;40m[38;5;14m[1m[3m [0m
|
||
|
||
[38;2;255;187;0m[4mpost-checkout[0m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mdelete-pyc-files[0m[38;5;12m (https://github.com/CompSciLauren/awesome-git-hooks/blob/master/post-checkout-hooks/delete-pyc-files.hook) - Delete all .pyc files every time a new branch is checked out. [39m
|
||
[38;5;12m- [39m[38;5;14m[1mnew-branch-alert[0m[38;5;12m (https://github.com/CompSciLauren/awesome-git-hooks/blob/master/post-checkout-hooks/new-branch-alert.hook) - Display a message when a new branch is checked out for the first time. [39m
|
||
|
||
[38;2;255;187;0m[4mpost-update[0m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mupdate-server-info[0m[38;5;12m (https://github.com/CompSciLauren/awesome-git-hooks/blob/master/post-update-hooks/update-server-info.hook) - Prepare a packed repository for use over dumb transports (e.g. http). [39m
|
||
|
||
[38;2;255;187;0m[4mpre-commit[0m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mdotenvx[0m[38;5;12m (https://github.com/CompSciLauren/awesome-git-hooks/blob/master/pre-commit-hooks/dotenvx.hook) - Prevent committing your [39m[48;5;235m[38;5;249m.env[49m[39m[38;5;12m file(s) to code. [39m
|
||
[38;5;12m- [39m[38;5;14m[1mformat-code[0m[38;5;12m (https://github.com/CompSciLauren/awesome-git-hooks/blob/master/pre-commit-hooks/format-code.hook) - Run command to format code and re-add any files modified after formatting. [39m
|
||
[38;5;12m- [39m[38;5;14m[1msearch-term[0m[38;5;12m (https://github.com/CompSciLauren/awesome-git-hooks/blob/master/pre-commit-hooks/search-term.hook) - Fail commit if a specific term is found in the code. [39m
|
||
[38;5;12m- [39m[38;5;14m[1mspell-check-md-files[0m[38;5;12m (https://github.com/CompSciLauren/awesome-git-hooks/blob/master/pre-commit-hooks/spell-check-md-files.hook) - Check files with .md extension for spelling errors. [39m
|
||
[38;5;12m- [39m[38;5;14m[1mverify-name-and-email[0m[38;5;12m (https://github.com/CompSciLauren/awesome-git-hooks/blob/master/pre-commit-hooks/verify-name-and-email.hook) - Fail commit if user.name or user.email is incorrect. [39m
|
||
|
||
[38;2;255;187;0m[4mprepare-commit-msg[0m
|
||
|
||
[38;5;12m-[39m[38;5;12m [39m[38;5;14m[1minclude-git-diff-name-status[0m[38;5;12m [39m[38;5;12m(https://github.com/CompSciLauren/awesome-git-hooks/blob/master/prepare-commit-msg-hooks/include-git-diff-name-status.hook)[39m[38;5;12m [39m[38;5;12m-[39m[38;5;12m [39m[38;5;12mInclude[39m[38;5;12m [39m[38;5;12mthe[39m[38;5;12m [39m[38;5;12moutput[39m[38;5;12m [39m[38;5;12mof[39m[38;5;12m [39m[38;5;12m"git[39m[38;5;12m [39m[38;5;12mdiff[39m[38;5;12m [39m[38;5;12m--name-status[39m[38;5;12m [39m[38;5;12m-r"[39m[38;5;12m [39m[38;5;12minto[39m[38;5;12m [39m[38;5;12mthe[39m[38;5;12m [39m[38;5;12mmessage,[39m[38;5;12m [39m[38;5;12mjust[39m[38;5;12m [39m[38;5;12mbefore[39m[38;5;12m [39m[38;5;12mthe[39m[38;5;12m [39m[38;5;12m"git[39m[38;5;12m [39m
|
||
[38;5;12mstatus"[39m[38;5;12m [39m[38;5;12moutput.[39m[38;5;12m [39m
|
||
[38;5;12m- [39m[38;5;14m[1minsert-issue-number[0m[38;5;12m (https://github.com/CompSciLauren/awesome-git-hooks/blob/master/prepare-commit-msg-hooks/insert-issue-number.hook) - Insert issue number to beginning of the commit message. [39m
|
||
|
||
[38;2;255;187;0m[4mpre-push[0m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mprevent-bad-push[0m[38;5;12m (https://github.com/CompSciLauren/awesome-git-hooks/blob/master/pre-push-hooks/prevent-bad-push.hook) - Prevent push of commits where the log message starts with "WIP" (work in progress). [39m
|
||
|
||
[38;2;255;187;0m[4mpre-rebase[0m
|
||
|
||
[38;5;12m-[39m[38;5;12m [39m[38;5;14m[1mprevent-rebase[0m[38;5;12m [39m[38;5;12m(https://github.com/CompSciLauren/awesome-git-hooks/blob/master/pre-rebase-hooks/prevent-rebase.hook)[39m[38;5;12m [39m[38;5;12m-[39m[38;5;12m [39m[38;5;12mPrevent[39m[38;5;12m [39m[38;5;12mtopic[39m[38;5;12m [39m[38;5;12mbranches[39m[38;5;12m [39m[38;5;12mthat[39m[38;5;12m [39m[38;5;12mare[39m[38;5;12m [39m[38;5;12malready[39m[38;5;12m [39m[38;5;12mmerged[39m[38;5;12m [39m[38;5;12mto[39m[38;5;12m [39m[38;5;12m'next'[39m[38;5;12m [39m[38;5;12mbranch[39m[38;5;12m [39m[38;5;12mfrom[39m[38;5;12m [39m[38;5;12mgetting[39m[38;5;12m [39m[38;5;12mrebased,[39m[38;5;12m [39m[38;5;12mbecause[39m[38;5;12m [39m[38;5;12mallowing[39m[38;5;12m [39m[38;5;12mit[39m[38;5;12m [39m[38;5;12mwould[39m[38;5;12m [39m[38;5;12mresult[39m[38;5;12m [39m[38;5;12min[39m[38;5;12m [39m
|
||
[38;5;12mrebasing[39m[38;5;12m [39m[38;5;12malready[39m[38;5;12m [39m[38;5;12mpublished[39m[38;5;12m [39m[38;5;12mhistory.[39m[38;5;12m [39m
|
||
|
||
[38;2;255;187;0m[4mquery-watchman[0m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mfsmonitor-watchman[0m[38;5;12m (https://github.com/CompSciLauren/awesome-git-hooks/blob/master/query-watchman-hooks/fsmonitor-watchman.hook) - Output to stdout all files that have been modified since a given time. [39m
|
||
|
||
[38;2;255;187;0m[4mupdate[0m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mupdate[0m[38;5;12m (https://github.com/CompSciLauren/awesome-git-hooks/blob/master/update-hooks/prevent-unannotated-tags.hook) - Block unannotated tags from entering. [39m
|
||
|
||
[38;2;255;187;0m[4mQuick Start[0m
|
||
|
||
[38;5;12m1. Pick a hook, any hook! Try the "verify-name-and-email" one if you're not sure where to start.[39m
|
||
[38;5;12m2. Navigate to your project's hooks folder (.git/hooks).[39m
|
||
[38;5;12m3. You should see a list of files already in there. Create a new file called the exact commit type that you want to use (eg: "commit-msg", "pre-rebase", "pre-commit", etc). Do not give it an extension.[39m
|
||
|
||
[38;5;12m![39m[38;5;14m[1mcreate new file[0m[38;5;12m (create-new-file.gif)[39m
|
||
|
||
[38;5;12m4. Open your new file and paste the code from the hook you chose out of this repo (eg: [39m[38;5;14m[1mverify-name-and-email.hook[0m[38;5;12m (https://github.com/CompSciLauren/git-hooks/blob/master/pre-commit-hooks/verify-name-and-email.hook)).[39m
|
||
[38;5;12m5. Save file. Done! Now the git hook will be triggered automatically.[39m
|
||
|
||
[38;2;255;187;0m[4mTools[0m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mHusky[0m[38;5;12m (https://github.com/typicode/husky) - Manage git hooks with a nice user interface.[39m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mOvercommit[0m[38;5;12m (https://github.com/sds/overcommit) - A fully configurable and extendable git hook manager.[39m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mGit Build Hook Maven Plugin[0m[38;5;12m (https://github.com/rudikershaw/git-build-hook) - Install Git hooks and config during a Maven build.[39m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mCaptainHook[0m[38;5;12m (https://github.com/CaptainHookPhp/captainhook) - Git hooks manager for PHP developers.[39m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mpre-commit[0m[38;5;12m (https://github.com/pre-commit/pre-commit) - A framework for managing and maintaining multi-language pre-commit hooks.[39m
|
||
|
||
[38;2;255;187;0m[4mWritten Guides[0m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mGit hooks documentation at git-scm.com[0m[38;5;12m (https://git-scm.com/docs/githooks)[39m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mGit Pro book by Scott Chacon and Ben Straub[0m[38;5;12m (https://git-scm.com/book/en/v2)[39m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mAn Introduction to Git Hooks[0m[38;5;12m (https://www.sitepoint.com/introduction-git-hooks/)[39m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mAtlassian Tutorial on Git Hooks[0m[38;5;12m (https://www.atlassian.com/ru/git/tutorials/git-hooks)[39m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mEasy git hooks with husky[0m[38;5;12m (https://www.vojtechruzicka.com/githooks-husky/)[39m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mGit Hooked[0m[38;5;12m (https://www.javascriptjanuary.com/blog/git-hooked 'Git Hooked')[39m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mHow To Use Git Hooks To Automate Development and Deployment Tasks[0m[38;5;12m (https://www.digitalocean.com/community/tutorials/how-to-use-git-hooks-to-automate-development-and-deployment-tasks)[39m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mAutomate Your Workflow with Git Hooks[0m[38;5;12m (https://hackernoon.com/automate-your-workflow-with-git-hooks-fef5d9b2a58c)[39m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mUsing JavaScript in Your Git Hooks[0m[38;5;12m (https://medium.com/@Sergeon/using-javascript-in-your-git-hooks-f0ce09477334 'Using JavaScript in Your Git Hooks')[39m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mAn In-Depth Look at Git Hooks[0m[38;5;12m (https://dzone.com/articles/an-in-depth-look-at-git-hooks)[39m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mGit hooks and practical uses. Yes, even on Windows.[0m[38;5;12m (https://www.tygertec.com/git-hooks-practical-uses-windows/)[39m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mAutomatically Manage Git Hooks with Direnv[0m[38;5;12m (https://knpw.rs/blog/direnv-git-hooks)[39m
|
||
|
||
[38;2;255;187;0m[4mVideo Guides[0m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mGit Hooks Part 1 - Getting Started[0m[38;5;12m (https://www.youtube.com/watch?v=aB3eq52sZSU)[39m
|
||
|
||
[38;5;12m- [39m[38;5;14m[1mGit hooks and practical uses. Yes, even on Windows.[0m[38;5;12m (http://www.youtube.com/watch?feature=player_embedded&v=fMYv6-SZsSo&t=140s)[39m
|
||
|
||
[38;2;255;187;0m[4mLicense[0m
|
||
|
||
[38;5;14m[1m![0m[38;5;12mCC0[39m[38;5;14m[1m (http://mirrors.creativecommons.org/presskit/buttons/88x31/svg/cc-zero.svg)[0m[38;5;12m (https://creativecommons.org/publicdomain/zero/1.0/).[39m
|
||
|
||
[38;5;12mgithooks Github: https://github.com/compscilauren/awesome-git-hooks[39m
|