Skip to content

Instantly share code, notes, and snippets.

@dialex
Last active September 28, 2018 16:55
Show Gist options
  • Save dialex/b43991d15057575cfb4973f2266b16ec to your computer and use it in GitHub Desktop.
Save dialex/b43991d15057575cfb4973f2266b16ec to your computer and use it in GitHub Desktop.
My purpose is to pull (rebase) all git repositories in the current directory
#!/bin/bash
#set -e #fail on first error
echo -e "🤖 My purpose is to pull (rebase) all your git repositories in this directory.\n"
for d in */ ; do
echo -e "\n>> Pulling git repo... ${d%?}"
cd $d;
#git pull -r;
git pull -r --autostash;
git remote prune origin;
cd ..
done
echo -e "\n🤖 It's done Rick."
read
@dialex
Copy link
Author

dialex commented May 24, 2018

TODO: based on input/flag use autostash

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