DEV Community

Discussion on: Hack or maybe not: "Deleting" master when it gets too big

Collapse
 
manlycoffee profile image
Sal Rahman

The only benefit that I see here is that I don't end up accidentally pushing to master, which has happened to many projects that I have worked on in the past.

Collapse
 
joelnet profile image
JavaScript Joel • Edited

One benefit is that you would not need to perform a merge. Any time you do git pull, you run the risk of having merge conflicts and having to merge.

New Branch with master

git checkout master
git pull # Possible Merge Conflicts!
git checkout -b my-new-branch

New Branch without master

git fetch
git checkout -b my-new-branch origin/master

The 2nd method to create a feature branch described will never run into merge conflict.

Another benefit is that you do not need to enter (checkout) the master branch to create a new feature branch. The feature can be created from anywhere.