Skip to content

Instantly share code, notes, and snippets.

@gandharva
Created December 17, 2015 06:15
Show Gist options
  • Select an option

  • Save gandharva/f86d2ebc26e1d0675b3e to your computer and use it in GitHub Desktop.

Select an option

Save gandharva/f86d2ebc26e1d0675b3e to your computer and use it in GitHub Desktop.
Script to track, fetch and pull all remote branches
#!/bin/bash
//Get all branches from remote and track them locally
for remote in `git branch -r`; do git branch --track ${remote#origin/} $remote; done
//Fetch all branches
git fetch --all
//Pull all branches
git pull --all
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment