| | 231 | |
| | 232 | If you will be working on a specific branch for a particular event (e.g. a deployment or hackathon), |
| | 233 | then you can add that branch to your local repository: |
| | 234 | {{{ |
| | 235 | git remote add <branch_name> https://github.com/flavour/<branch_name>.git |
| | 236 | git fetch <branch_name> |
| | 237 | }}} |
| | 238 | Now you have both the master branch from the trunk repository, and the specific branch <branch_name>. |
| | 239 | |
| | 240 | You can push branches other than master to your !GitHub repository. |
| | 241 | {{{ |
| | 242 | git push -u origin <branch_name> |
| | 243 | }}} |
| | 244 | Note it is good to specify the branch name to push, else git will try to push all of them. |
| | 245 | The -u tells git to make your local branch "track" the remote branch. This is only needed on |
| | 246 | the first push to that branch. |
| | 247 | |
| | 248 | If you need a specific revision of the current branch, your can check out that revision on a new branch: |
| | 249 | {{{ |
| | 250 | git checkout -b <revision> <branch_name> |
| | 251 | }}} |
| | 252 | (git requires a name for a branch if you want to preserve commits.) |