DEV Community

Discussion on: Git Workflow: Do you commit to master on your solo projects?

Collapse
 
gnsp profile image
Ganesh Prasad

Normally I work on the master branch in the initial phase. Once I reach a stable state with the most basic functionalities, I branch out. If there are more than one way of implementing something that I need to try out, then implementing them in separate branches makes more sense to me.

Like you mention, while working solo, one works on one feature at a time -- that's true for 9 cases out of 10. Even so I prefer working on a separate development branch. In any case, switching to a stable branch is always faster and easier than finding the stable commit and checking out to that commit.

Collapse
 
0ctavia profile image
Octa

I think I'll start implementing this workflow from now on. It makes more sense than the whole "now in which commit did I f things up".

Collapse
 
terabytetiger profile image
Tyler V. (he/him)

I've been using and loving this workflow! I mostly started with it because Netlify pushed me toward it.

I will chip away at my side projects between 3-4 computers, so I ended up needing the branches to prevent incomplete work getting pushed to the live site 😅

Collapse
 
daveskull81 profile image
dAVE Inden

Netlify is the reason for my working this way too lately. I haven't been working on these projects across multiple computers, but I might. Branching is a good way to help that from getting too messy while keeping the live site working smoothly.

Thread Thread
 
yvonnickfrin profile image
🦁 Yvonnick FRIN • Edited

Did you know Netlify has a Deploy preview feature that deploys the code of your branch on a special url ?

Thread Thread
 
daveskull81 profile image
dAVE Inden

I have seen this! It looks really useful. I am interested to try it out.

Collapse
 
guneyozsan profile image
Guney Ozsan

Some of my projects go like this as well.

Collapse
 
derickhess profile image
Derick Hess

This is exactly the way I work on my solo projects as well. I prefer master to be the stable branch at all times

Collapse
 
woody_tanner profile image
Tanner Woody

I'm reading "prefer" as mandating here 😂 Who would want their master to not be the stable branch! That's just scary 😶

Collapse
 
thomas_ph35 profile image
Thomas

Same for me !

don't know if it's habits, but it makes more sens to me has well.

Collapse
 
marcus-sa profile image
Marcus S. Abildskov

I do the same.
After having reached a "stable" repository, I branch out and use Gitflow.
Master should ALWAYS be a working project/application.
When you have CI/CD this is really important as it'll most likely trigger on PRs being merged into your master branch.