Skip to content

Instantly share code, notes, and snippets.

@mfurquimdev
Created September 1, 2021 12:39
Show Gist options
  • Select an option

  • Save mfurquimdev/40082034fed05433e30147c05126e90e to your computer and use it in GitHub Desktop.

Select an option

Save mfurquimdev/40082034fed05433e30147c05126e90e to your computer and use it in GitHub Desktop.
Crawl project directories and update master branches
for d in *;
do
if [ -d "$d" ];
then
pushd "$d";
update_master.sh
popd;
fi;
done;
if [ -d .git ];
then
current_branch=$(git branch --show-current);
git checkout master;
git pull;
git checkout ${current_branch};
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment