Skip to content

Instantly share code, notes, and snippets.

Last active Jan 26, 2018
What would you like to do?
Script to checkout a list of "repos" to certain branch, pull changes and run grunt.

Checkout, pull and run grunt

  1. Copy this bash into your /usr/local/bin folder
  2. Assign execution permissions
  3. Create another file named repos.txt
  4. In repos.txt list with full path each of the repos you want to be part
  5. Update the bash with the full path to your repos.txt file
while read p; do
echo "▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇ $p ▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇▇"
cd "$p" &&
git reset --hard &&
git checkout $BRANCH &&
git pull &&
done < repos.txt
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment