Skip to content

Instantly share code, notes, and snippets.

@bryantjustin
Last active August 29, 2015 14:01
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bryantjustin/493d1bdf7559201f5ecb to your computer and use it in GitHub Desktop.
Save bryantjustin/493d1bdf7559201f5ecb to your computer and use it in GitHub Desktop.
Bash script that executes pod install.

Cocoapods git post-checkout

The following will execute pod install between checkouts. This is particularly useful for projects where the Pods directory is not checked in.

Installation:

  • Navigate to your project on terminal.
  • Open .git/hooks/post-checkout with your favourite text editor.
  • Copy and paste the following script:
#!/bin/sh
if [ -r Podfile ] ; then
  pod install
fi
  • Set permissions for the post-checkout directory:
[sudo] chmod +x .git/hooks/post-checkout

Cocoapods will now install from the podfile between checkouts.

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