Skip to content

Instantly share code, notes, and snippets.

@toto
Created December 11, 2014 11:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save toto/3cedf52626e219824068 to your computer and use it in GitHub Desktop.
Save toto/3cedf52626e219824068 to your computer and use it in GitHub Desktop.
Put this in .git/hooks/post-checkout, make it executable with chmod u+x .git/hooks/post-checkout. Now git will complain when you have to do pod install after witching branches. You can also symlink it to .git/hooks/post-merge so it also is run after merge/pull
#!/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-checkout
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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment