Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do you use git in "solo-development" (without team)?

I work as a freelancer on small projects, and all of them I'm doing alone, without a team.

I tried to use the Git Flow. At first, all was well. There were branches for features, small commits with meaningful description, merges.

But the process always ends with enormously large commits direct to master branch, with descriptions like "big update", "some update".

How do you deal with it? Do I need Git Flow in my case or not?

like image 515
svfat Avatar asked Jan 08 '23 07:01

svfat


1 Answers

But the process always ends with enormously large commits direct to master branch, with descriptions like "big update", "some update".

This is what git rebase --interactive and git add --patch are for.

Here's the first thing you've got to do: you have to make yourself a crazy person. No, two crazy people, each convinced the other is someone else. No, wait, that's not right. Three crazy people.

There's the (currently sane) you you already know, who's done this work and doesn't see anything else to say about it. So: the first step to a crazy you and a sane history is the new (but purely imaginary fragment of) you the code reviewer, who knows absolutely nothing about the changes you've made until she sees the commit message and the patch. You need to be respectful of that person's time. The third part, that takes this from useful quirk to full-on insanity, is the rubber duck. It's an open question whether carrying around an actual rubber duck or simply having an imaginary confidante that just happens to be a rubber duck is more disturbing to others' sense of reality (to say nothing of your own).

So, two crazy people and a duck.

If the rubber duck can't understand your explanation, or the reviewer can't understand your code, then simplify until they can. Break up the commits into independent parts that don't break the build and don't leave the reviewer or the duck wondering why everything in each needs to be there to keep everything working right.

See, if you set it up so doing the right thing has massive entertainment value, the world will be good. If you don't, it'll be by comparison at least unpleasant and boring. The only time not to do this is when you can already feel how badly you're going to need this stuff done right in a few months, then it's just a waste of time. But if you're going to lose it, make sure you get something even more valuable in exchange.

rebase and add are necessary whether you're having fun or not.

like image 195
jthill Avatar answered Jan 16 '23 18:01

jthill