Skip to content

Instantly share code, notes, and snippets.

@stigi
Last active August 29, 2015 13:55
Show Gist options
  • Save stigi/8706344 to your computer and use it in GitHub Desktop.
Save stigi/8706344 to your computer and use it in GitHub Desktop.
A simple git hook that let's you know whenever you need to update your CocoaPods after merging or pulling from a remote.
#!/bin/bash
#
# Let's you know when your pods should be updated right after a git pull or git merge
# Also works for fast-forward pulls.
#
# To enable this hook for your project, save it as .git/hooks/post-merge
diff "Podfile.lock" "Pods/Manifest.lock" > /dev/null
if [ $? != 0 ] ; then
echo
echo "[COCOAPODS] The sandbox is not in sync with the Podfile.lock."
echo " Run 'pod install' or update your CocoaPods installation."
echo
#pod install # uncomment this line to update the pods whenever necessary
fi
@toto
Copy link

toto commented Feb 3, 2014

Why /bin/bash? /bin/sh should do fine

@toto
Copy link

toto commented Feb 3, 2014

You could also use this in post-checkout

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment