DEV Community

Discussion on: A Fool-Proof Way to Keep Your Fork Caught Up in Git

 
jacobherrington profile image
Jacob Herrington (he/him)

What I do, is create a branch for each new feature. I usually have quite a few commits in each PR, but they are all for the same feature on what most people refer to as a 'feature branch' (meaning a branch specifically for that feature).

So if I'm going to fix some documentation, I'd make a branch from master called documentation-fixes.

git checkout master
git checkout -b documentation-fixes
git commit -am "Some doc fixes!"

Then when I got to implement a feature, I'd make a new branch from master:

git checkout master
git checkout -b some-new-feature
git commit -am "Some feature!"
Thread Thread
 
kaushalgautam profile image
Kaushal Gautam

I understand now. Thanks for such detailed explanations! They really help a lot. And congratulations on the new job! :)