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.

Latest comments (51)

Collapse
 
vicpal25_70 profile image
vicpal25

Always! In fact it’s easy to go back in history and compile features from an RC for a client when they are properly tagged and merged back into Master.

Collapse
 
adriens profile image
adriens

For apis for example targetting Heroku CD, I have at least a dedicated branch

Collapse
 
coopercodes profile image
🧸 🏳️‍🌈 cooper-codes 💻 🎮

I never used to, basically only worked on smaller solo personal projects and didn’t see the need.
I do now, as my projects are getting bigger and often have some kind of continuous integration on Main branch.
Personally I don’t think it’s needed for smaller solo projects for anything other than to get comfortable with using git processes, but for that alone it is worth it.

Collapse
 
goodevilgenius profile image
Dan Jones

I use git flow for most of my personal projects. So, I have a prod branch and a develop branch. When I've got a new version, I merge develop into prod.

I will occasionally create feature branches, if I know it might take a while to work on it. But most small stuff is put into the develop branch directly.

If anybody else were working on it, I'd be more strict and always use a feature branch.

For stuff like my blog or personal website, I only have a single branch. I don't push until I've got it ready. If I'm working on a blog post on one computer, and want to switch computers to finish it, then I'll create a branch and push it there.

Collapse
 
davidmmooney profile image
davidmmooney

I use a branch to do the work and then I send myself a PR to merge to main. This forces me into a context shift from "developer" to "reviewer". There's a lot of things my eyes will just drift past in my editor that I will flag when I'm explicitly doing quality control.

Collapse
 
0916dhkim profile image
Danny Kim

I also do this. One main branch and thousands of short-lived feature branches (e.g. enhance/add-profile-component) which get closed immediately after PR.

Collapse
 
gawetaner profile image
Gawetaner

Yes, i always use a git flow like approach. Except small projects that are used only once and done in an hour or two.

Collapse
 
darthbob88 profile image
Raymond Price

Yeah, with PRs and CI/CD so I can make sure that even my dopey little project only gets deployed if it's actually working properly.

Collapse
 
katafrakt profile image
Paweł Świątkowski

Yes, but mostly for bigger experiments (new layouts, changing libs, upgrading main framework), when I want to be able to still do quickfixes on main/master when needed.

Collapse
 
abdisalan_js profile image
Abdisalan

never -- straight to master!

Collapse
 
promikecoder2020 profile image
ProMikeCoder2020

What's the reasoning behind using branches in a solo side project?

Collapse
 
0916dhkim profile image
Danny Kim

I use PR for CI purposes because it is easier to track down failing tests with PRs. And you cannot open PR without a branch!