Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
git pull all the repositories in a directory
#!/bin/bash
for d in ./*/;
do (
cd "$d" &&
currentDir=`pwd`
echo "updating `basename "$currentDir"`..."
git pull
);
done
@rishikeshdhokare
Copy link
Author

rishikeshdhokare commented May 14, 2018

Additionally add an alias for running this file -

Add following at the bottom of .bashrc file
alias git_refresh='cd <directory containing multiple git repositories> && ./git_refresh.sh'

@rishikeshdhokare
Copy link
Author

rishikeshdhokare commented May 14, 2018

For iTerm with zsh -
add the alias to .zshrc and source it

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