peakpg/git-er-done — Issue #4: Have one command to create local branches that track all remote branches
Author: peakpg
Created: 2012-01-16 20:53:53+00:00
State: open

Using basic Git, if you have a project that has one or more remote branches, you have to manually create a local tracking branch for each remote. Example:

```
$ git branch -a
* master
remotes/origin/3.0-stable
remotes/origin/3.1-stable
remotes/origin/3.3.x
remotes/origin/HEAD -> origin/master
remotes/origin/master
```

This has 4 remote branches (master, 3.0-stable, 3.1-stable, 3.3.x). As per [this article](http://gitready.com/beginner/2009/03/09/remote-tracking-branches.html_To create a local branch, you need to do the following 4 times:

```
git branch --track 3.1-stable origin/3.1-stable
```

It would be nice if the tool could just do this automatically, like:

```
gd track-remotes
```

Could even ask questions of the user (to skip or rename local branches).