Skip to content

Instantly share code, notes, and snippets.

@Data-ptr
Created January 14, 2016 18:10
Show Gist options
  • Select an option

  • Save Data-ptr/cfe2f512945709a96b93 to your computer and use it in GitHub Desktop.

Select an option

Save Data-ptr/cfe2f512945709a96b93 to your computer and use it in GitHub Desktop.
Just authenticated to a Heroku login and want to quickly clone all the applications into their own directories? In a "one-liner?" Remember, you have to be authenticated, `$ heroku apps` should list the applications.
for HEROKU_APP in $(heroku apps | tail -n+2); do export REPO_DIR="heroku-${HEROKU_APP}"; if [ ! -d "$REPO_DIR" ]; then mkdir "$REPO_DIR"; cd "$REPO_DIR"; heroku git:clone ./ -a "${HEROKU_APP}"; cd ..; fi done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment