Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!bash
- # This script goes into every subfolder, sniff for all local branches and try to pull from git repo.
- # Finally returns back to current branch.
- ls -d */ | while read repo
- do
- echo "Switch to $repo"
- cd "$repo"
- current_branch=$(git rev-parse --abbrev-ref HEAD)
- echo "current branch: $current_branch"
- git stash && git branch --format='%(refname:short)'|
- while read lbranch
- do
- git checkout "$lbranch" && git pull
- done
- echo "switch back to $current_branch"
- git checkout "$current_branch"
- cd ..
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement