Make sure I'm up to date
git pull
Get a local copy of the new branch
git checkout --track -b stable origin/stable
Confirm I can push and pull to both branches
git remote show origin
Which shows this:
penitentes:csh_home cpowell (2-0-stable)$ git remote show origin
* remote origin
Fetch URL: git@github.com:abakas/csh_home.git
Push URL: git@github.com:abakas/csh_home.git
HEAD branch: master
Remote branches:
2-0-stable tracked
master tracked
Local branches configured for 'git pull':
2-0-stable merges with remote 2-0-stable
master merges with remote master
Local refs configured for 'git push':
2-0-stable pushes to 2-0-stable (up to date)
master pushes to master (up to date)
And then I can switch between branches with:
git checkout [my branch name]
There are two gotchas that I ran into:
- If you don't give your local branch the same name as the remote branch, you won't be able to push.
- When you pull the new branch, your changes will go on the new branch as well.
No comments:
Post a Comment