Don't let yourself be reduced to statistics by following blindly the words of fools. Don't get paralysis by analysis. Get in there and get stuff done.
Git is a tool to version your work. Everything else is extra. Feeling bad for not having branches that "do one _useful(?)_ thing" and commits including their own tests, what the?
Articles like these are toxic, imho. Use tools to empower you, not enslave you.
2b. is something to debate on. I prefer to use git branches as a work stage tracker. Commit last known good state, off to the races on the next batch. So, it’s okay to push something with broken tests on a branch as long as tests work when merging to main. Then again, this argument sorta kinda holds if one works with squash commits. Nobody should care what’s on the branch and how many commits in what state are there. My branch is my scratch pad. The state matters during the merge of a pull request.
1. is also interesting. A branch must do one useful thing. Can it do more than one?
All in all, those rules are too taxing for my liking.
I guess if your work approach is exceptionally chaotic, it makes sense. But I don’t think I would ever have the time to be as chaotic as the author seems indicate they are.
I'm experimenting with this workflow: lean into the Git messiness, git reset --hard all my "bad" commits, and then re-write history to make the "clean" commits that follow principles like these.
I use commits as rollback points. If something works and I want to try something risky, I commit first. I don't care about the commit message. I basically never look at any commit older than one month
I hardly ever look at commits older than the last commit.
I don't often create branches for features; I find having permanent Production / Test / Dev branches is sufficient for most work. But I will create other branches as needed.
Git worktree is awesome for having multiple branches checked out all at the same time. At this point, I almost never switch branches and instead check them out into their own directory.
that's why i created https://github.com/steveschnepp/git-breadcrumb
A little rough but works well enough for my current workloads.
It means the commit only needs to make sense to my self until next week.
If I see a commit from 2 weeks ago and I don't know what the message means, who cares? I hardly look at those commits.
In the past I used it for backups and versioning plus managing PRs even for solo stuff. Now I've started using my VPS as the upstream server, and realized that even on a team project I can replace a lot of the core github functionality easily. The big advantage being there is an automatic extra backup (My computer is backed up anyway but the post probable failure mode is me screwing up git somehow so it's good to have a remote upstream)
What does that even mean?
git commit -a -m “wip”
every few hours
every single article about git comments on this "feature" of git...isnt it time we all removed the aura of geniousness to git and bloody moved on to something better?, (like svn for instance)
- the individual opportunity costs of learning multiple VCSs likely outweigh the cost of learning 1, even if it's suboptimally difficult
- the community-wide leverage lost by having significant fractions of prospective oss devs who aren't comfortable contributing via one VCS or another probably outweighs the marginal leverage lost by alienating the fraction of prospective oss developers that find git unlearnable or oppressive or whatnot
(I am ~fine with breaking the monoculture for a once-a-generation move to a clearly superior model, but there's a risk of fracturing the ecosystem across several VCSs for decades to come.)
For some reason, I never grokked svn. Something about the use of directories as versions always threw me for a loop. Maybe if I spent the time to really learn it I'd like it, but that isn't likely to happen these days.
It was a simple and clever design but it's hard to argue for it when compared distributed nature of git and its ubiquity.