DEV Community

Cover image for Do you Git Branch in personal projects?
Madza
Madza Subscriber

Posted on

Do you Git Branch in personal projects?

Most devs are aware, that Git Branches are awesome for developing new features collaboratively in complex apps. For personal projects, I've seen most devs pushing everything to master, tho.

Is this because devs being lazy and lack proper project organization or do you also think branching in personal projects is unnecessary?

Even if you work alone, I still see them as useful, especially if you develop new features and have a master branch in production.

Oldest comments (51)

Collapse
 
patarapolw profile image
Pacharapol Withayasakpunt • Edited

Of course, if master has been stable, and I cannot break things; I will indeed branch. I will consider tests and CI as well.

So it depends on maturity.

Collapse
 
thomasbnt profile image
Thomas Bnt

Yeah of course! Always versionning privates projects with only me to contributor.

Example :

Main branch — For production
Dev branch — For dev and test mode
Enter fullscreen mode Exit fullscreen mode

When dev is ready, I merge all on main branch 😄☕

Collapse
 
florianjisopp profile image
Florian J. Isopp

I also like this approach

Collapse
 
ronan696 profile image
Ronan D'Souza

I too follow this approach 😎

Collapse
 
yoursunny profile image
Junxiao Shi • Edited

I used to have master only. If CI fails or I find a typo, I'll force push. I keep getting complaints regarding the force pushes.

Now I have main and develop. I use develop just like how I used master in the past, and push to main when I'm sure I don't need force push. main has a branch protection rule that requires CI passing and forbids force pushes.

Collapse
 
arskeliss profile image
Csokán Pál András

Brilliant, I shall follow this approach as well. >Thanks for mentioning it.

Collapse
 
madza profile image
Madza

Solid approach 👍

Collapse
 
daviddalbusco profile image
David Dal Busco • Edited

Of course there is always the quick fix or whatever, but I would say that 99% of the time I always use branches for my personal projects too.

Since a year or so I even almost always create PR too, even if I merge these a few seconds after their opening. I feel like it is more traceable doing so, specially for open source work published on GitHub.

Collapse
 
mintjar profile image
Martijn van de Beek

On personal projects I am usually less strict. I create branches for new features and experiments when I feel the need but smaller and shorter projects are usually easy to maintain with only commits and stashing. Especially in the beginning of a project.

Collapse
 
_garybell profile image
Gary Bell

For most projects, yes. If it's a code/development repository I do.

I'm currently working on using GitLab to hold my blog drafts, but I only use the main branch for that so I'm not chopping and changing branches to work on different posts

Collapse
 
darkwiiplayer profile image
𒎏Wii 🏳️‍⚧️

Not really. I tend to focus on one thing at a time so there's no point in using feature-branches, as I'd only ever have one of them at a time anyway.

I also don't see much of a point in separating dev and stable branches since that's what tags are for and in personal projects that's more than enough.

Collapse
 
adriens profile image
adriens

Same here, focusing on one thing at a time and realease fast each feature

Collapse
 
arskeliss profile image
Csokán Pál András

Never tried it before, but I had it in mind to give it a go for a simple project. Then afterwards I will have the knowledge to fully use it as a semi-pro.

Collapse
 
polaroidkidd profile image
Daniel Einars

yes, all the time. I use my personal website as a type of playground so I try different things. Some of them I merge, others I drop again. I also use standard-version and commitLint to keep my master commits clean and generate a CHANGELOG.md

Collapse
 
snyderling profile image
David Snyder

I try to branch off main as much as possible but i forget sometimes. For the past few months I have even tried to make a PR for each branch even if I merge these a few seconds after their opening.

Collapse
 
zarszz profile image
Ganjar Gingin Tahyudin

use multi branch, ci/cd, and multi-stage