Q:

Git (DVCS) Best Practice

I am new to Github and recently forked somebody's project to make my own changes. Now though I learn it's best practice to create each new feature or bug fix in a new branch. Up until now I was just editing in the Master.
How can I can create a new branch out of my Master, then replace my edited master with the upstream code repository once again?

A:

Assuming the upstream repo is origin...
git branch some_feature
git reset origin/master

Now your branch is where the remote master branch is, and your code is on the branch some_feature.

