I'm a single developer. I use git for my projects.
For every single feature (Ex. Login/register pages), I create a new branch to implement it
Later I merge that branch in my master.
Now I have like 20+ branches and I feel like i'm doing it in the wrong way.
Is git branches necessary for a single developer?
The main purpose of the branch is that you can leave the master untouched and stable, rather than having part-completed features that may cause issues. You could solve the problem with just one non-master branch for the current in-flight feature - delete all the old ones. You can avoid holding up a release working this way, because you won't say "we can't release because feature X is only half complete".
You can also solve the problem by working directly in master, but key-stoning the feature so it isn't visible to users until it is complete. You need good CI practices to give you the confidence to do this.
Once you have reintegrated your changes in the master you should delete your old branch. You just need to branch out if you absolutely need the specific change to be isolated.
If your project does not have many forks you dont need to keep these change isolate because the master is the only branch you need to migrate your changes.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With