Skip to content

Instantly share code, notes, and snippets.

@tamtamchik
Created June 4, 2012 17:25
Show Gist options
  • Star 8 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save tamtamchik/2869690 to your computer and use it in GitHub Desktop.
Save tamtamchik/2869690 to your computer and use it in GitHub Desktop.
Fetch all branches & tags from remote git repository.
#!/bin/bash
for branch in `git branch -r | grep -v HEAD | grep -v master`; do
echo ${branch##*/} $branch
done
echo "Fetching..."
git fetch --all
echo "Pulling..."
git pull -v
echo "Results: Branches"
git branch -a
echo "Results: Tags"
git tag
@filipekiss
Copy link

Hey, just made a little improvement so we can discard the grep remotes part. https://gist.github.com/3146491 :)

@tamtamchik
Copy link
Author

Updated up to @filipekiss variant! Thanks, dude!

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