These git hooks runs bundle or npm install automatically whenever you:
git checkouta new branch with a different Gemfile or package.json.git pulla change to Gemfile or package.json.
cd awesome_git_repo
| console.log(1); | |
| (_ => console.log(2))(); | |
| eval('console.log(3);'); | |
| console.log.call(null, 4); | |
| console.log.apply(null, [5]); | |
| new Function('console.log(6)')(); | |
| Reflect.apply(console.log, null, [7]) | |
| Reflect.construct(function(){console.log(8)}, []); | |
| Function.prototype.apply.call(console.log, null, [9]); | |
| Function.prototype.call.call(console.log, null, 10); |
| #!/bin/bash | |
| # Run cputhrottle for a list of applications in order to limit their CPU usage. | |
| # This script needs `pidof` and `cputhrottle` installed, which can be installed from homebrew. | |
| # NOTE: This script was tested on MacOS only. | |
| if [[ $EUID > 0 ]]; then | |
| echo "Please run this script as root/sudo" | |
| exit 1 | |
| fi |
| #/usr/bin/env bash | |
| changed_files="$(git diff-tree -r --name-only --no-commit-id $1 $2)" | |
| check_run() { | |
| echo "$changed_files" | grep --quiet "$1" && eval "$2" | |
| } | |
| check_run npm-shrinkwrap.json "npm prune && npm install" | |
| # check_run package.json "npm prune && npm install" |
| Look at the README. |
| #/usr/bin/env bash | |
| # MIT © Sindre Sorhus - sindresorhus.com | |
| # forked by Gianluca Guarini | |
| changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
| check_run() { | |
| echo "$changed_files" | grep -E --quiet "$1" && eval "$2" | |
| } |
| #!/usr/bin/env bash | |
| # MIT © Sindre Sorhus - sindresorhus.com | |
| # git hook to run a command after `git pull` if a specified file was changed | |
| # Run `chmod +x post-merge` to make it executable then put it into `.git/hooks/`. | |
| changed_files="$(git diff-tree -r --name-only --no-commit-id ORIG_HEAD HEAD)" | |
| check_run() { | |
| echo "$changed_files" | grep --quiet "$1" && eval "$2" |
brew install git bash-completion
Configure things:
git config --global user.name "Your Name"
git config --global user.email "[email protected]"