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)
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.
Yeah of course! Always versionning privates projects with only me to contributor.
Example :
When dev is ready, I merge all on main branch 😄☕
I also like this approach
I too follow this approach 😎
I used to have
masteronly. If CI fails or I find a typo, I'll force push. I keep getting complaints regarding the force pushes.Now I have
mainanddevelop. I usedevelopjust like how I usedmasterin the past, and push tomainwhen I'm sure I don't need force push.mainhas a branch protection rule that requires CI passing and forbids force pushes.Brilliant, I shall follow this approach as well. >Thanks for mentioning it.
Solid approach 👍
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.
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.
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
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.
Same here, focusing on one thing at a time and realease fast each feature
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.
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-versionandcommitLintto keep my master commits clean and generate aCHANGELOG.mdI 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.
use multi branch, ci/cd, and multi-stage