Skip to content

Instantly share code, notes, and snippets.

@danielcarr
danielcarr / pod-update-post-checkout
Last active September 16, 2022 12:38 — forked from kreeger/pod-install-post-checkout
A post-checkout hook for running pod install if necessary checking out a branch
#!/usr/bin/env sh
from_branch=$1
checked_out_branch=$2
check_out_type=$3 # changing branches = 1; checking out a file = 0
# If checking out a fresh clone
if test $from_branch = 0000000000000000000000000000000000000000 ; then
from_branch=`git hash-object -t tree /dev/null` # a hash representing an empty tree/repo
fi