Skip to content

Instantly share code, notes, and snippets.

@Idnan
Created May 8, 2020 15:56
Show Gist options
  • Save Idnan/c26aa339b42fc1a59986af3df3c82136 to your computer and use it in GitHub Desktop.
Save Idnan/c26aa339b42fc1a59986af3df3c82136 to your computer and use it in GitHub Desktop.
Script to update all your git repos with remote
pull-latest() {
for dir in $(find . -name ".git")
do cd ${dir%/*}
echo $PWD
git reset --hard HEAD
git checkout develop
git pull origin develop
if [ -f "./package.json" ]; then
yarn install
fi
echo ""
cd - > /dev/null
done
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment