Question

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?

Was it helpful?

Solution

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.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top