Skip to content

Instantly share code, notes, and snippets.

@kirkins
Created July 5, 2017 19:30
Show Gist options
  • Save kirkins/14f1be3dd6c7e8a343cd06fb93d9a6fe to your computer and use it in GitHub Desktop.
Save kirkins/14f1be3dd6c7e8a343cd06fb93d9a6fe to your computer and use it in GitHub Desktop.
R10K Helper - apply function to each branch
#!/usr/bin/env bash
for branch in $(git for-each-ref --format='%(refname)' refs/heads/); do
git checkout "$branch"
# run commands on branch here
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment