3/ Working with Branches

Working with branches

Remember that new branches should be created off of the staging branch.
Occasionally, you should make sure that you have the most-up-to-date staging branch within your fork by running the following commands:
1
git fetch upstream
2
git checkout staging
3
git merge upstream/staging
Copied!
You should always be working inside a branch while solving an issue.
Make commits within the branch, and then -- when you're ready, push up the branch:
git push --set-upstream origin BRANCHNAME

How to see a list of all existing branches

Type git branch -a to see a list of all available branches.

Switching branches

If you want to switch to an already-created branch, you would type git checkout BRANCHNAME.

How to create a new branch

git checkout -b BRANCHNAME
Remember that our convention is to name the branch after the issue number we're working on.
Last modified 3yr ago