Skip to content

Instantly share code, notes, and snippets.

@juanpablocs
Last active October 16, 2017 17:41
Show Gist options
  • Save juanpablocs/81c68f6259f7a8f69497d885578ef521 to your computer and use it in GitHub Desktop.
Save juanpablocs/81c68f6259f7a8f69497d885578ef521 to your computer and use it in GitHub Desktop.
access each folder that matches the regex

bash git pull each dir

Execute command:

git_current_branch () {
  #https://stackoverflow.com/a/35298459
  echo $(git branch | grep '^*' | sed 's/* //' )
}
for dir in microservices-* do
  echo "$dir\n"
  (cd $dir && git pull origin $(git_current_branch))
  echo "\n"
done
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment