Skip to content

Instantly share code, notes, and snippets.

@santutu
santutu / pre-commit
Created February 2, 2024 12:35 — forked from bitinn/pre-commit
pre-commit hook to prevent large file on git commit (and allow git-lfs tracked binary files to pass through)
#!/bin/sh
#
# An example hook script to verify what is about to be committed.
# Called by "git commit" with no arguments. The hook should
# exit with non-zero status after issuing an appropriate message if
# it wants to stop the commit.
#
# To enable this hook, rename this file to "pre-commit".
# Redirect output to stderr.
@santutu
santutu / pre-push-lfs.sh
Created February 2, 2024 12:07
pre-push hook for git lfs. Prevent to ocurr error when pushing large files.
#!/bin/sh
command -v git-lfs >/dev/null 2>&1 || { echo >&2 "\nThis repository is configured for Git LFS but 'git-lfs' was not found on your path. If you no longer wish to use Git LFS, remove this hook by deleting '.git/hooks/pre-push'.\n"; exit 2; }
git lfs pre-push "$@"
# This pre-push hook will check any non git-lfs tracked files that are about to be pushed and make sure they are not too big.
# Big files can be migrated to LFS using [git lfs migrate]
#
# To enable this hook, rename this file to "pre-push".
# It should be installed to a path like "[Reponame]/.git/hooks/pre-push".
!function(e){function t(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,t),o.l=!0,o.exports}var n={};t.m=e,t.c=n,t.i=function(e){return e},t.d=function(e,n,r){t.o(e,n)||Object.defineProperty(e,n,{configurable:!1,enumerable:!0,get:r})},t.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(n,"a",n),n},t.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},t.p="/",t(t.s=3)}([function(e,t,n){n(8);var r=n(6)(n(2),n(7),null,null);e.exports=r.exports},function(e,t){e.exports=Vue},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.default={name:"shaker"}},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n.n(r),s=n(0),a=n.n(s);o.a.component("shaker",a.a)},function(e,t,n){t=e.exports=n(5)(),t.push([e.i,"","",{version:3,sources:[],names:[],mappings:"",file:"Shaker.vue",sourceRoot:""}])},function(e,t){e.exports=function(){var e=[];return e.