Skip to content

Instantly share code, notes, and snippets.

@cameronmalek
cameronmalek / keybase.md
Last active April 16, 2016 21:22
Keybase.io

Keybase proof

I hereby claim:

  • I am cameronmalek on github.
  • I am cameronmalek (https://keybase.io/cameronmalek) on keybase.
  • I have a public key ASCPAtxsnLmJ2zQpL9wY1RK80_yXRMxLQB1cGAXZ1mW1Rgo

To claim this, I am signing this object:

@cameronmalek
cameronmalek / pre-receive.sh
Last active February 4, 2019 18:37
The `hooks/pre-receive` file I use for cameronmalek.com and other sites. It makes sure the working directory is clean before pushing updates, forcing the developer to commit and pull server-side updates first. It doesn't detect any staged, uncommitted files. A situation where someone stages but fails to commit a file isn't anticipated.
#!/bin/sh
export GIT_WORK_TREE=/home/cameronm/public_html/
export GIT_DIR=/home/cameronm/git/cameronmalek.git
ec=0
# test for unstaged, uncommitted files
git diff --exit-code &>-
if [ "$?" -ne 0 ]; then
echo "Changes not staged"