How I Use Git
registerspill.thorstenball.com
registerspill.thorstenball.com
Nobody needs a gui for git or a text editor but using magit is like a superpower compared to the command line. It is probably the best piece of software i've ever used. you can even drop down to the command line git inside of it if you need. i don't understand why anyone would prefer the cli over it.
My second favorite is "c F" or instant fix up.
But I've seen a magit power user, and arguably:
magit is the only git client I've seen that does some things better than CLI without being severely disempowered.
I only prefer the CLI over magit because I don't use Emacs. I'm not switching back to Emacs because of magit (or org-mode).
LSP is just too big for me, and Emacs has poor LSP, both in rendering, back-end performance, and effort setting it up.
Because it shows more information about the state and spares you the trouble of navigating much of the zoo that is git cli design
For example,
> It shows the current branch and whether the repository is dirty, i.e. whether it has uncommitted changes
And the GUI would also show what/where those changes are and allow jumping to edit them. And you'd get updates after you edit even without manually refreshing the prompt
Yeah. I understand the inner workings of git and am perfectly capable of using git on the command line but the git cli is just so horribly designed. I regularly have to google how to perform rather basic actions because the cli just isn't structured in any sensible way.
I could have written it.
Now I can share it with others and say "This is 96% me."
- I use gap instead of gaa. (He also uses git add -p, but no alias?)
- I didn't have 'git lr', but I do now.
- I use `git commit --amend` more often.
- Pull request workflows exactly the same.
- Same policy on rebasing main onto feature branches.
- Same behavior around reviewing and self-reviewing.
- Same tendency to commit and cherry-pick off a branch.
- ...
My Atuin frequency table for git-specific commands: gs # git status
gap # git add -p
gl # git log
gc # git commit (with -m, -v or --amend)
ga # git add
gdc # git diff --cached
gd # git diff
gp # git push (sometimes with --force-with-lease)
gco # git checkout
gpr # git pull --rebase --prune
git restore
git config
git rebase
I actually use Conventional Commits. I spent a total of 5 minutes bike-shedding "chore".I didn't use "chore" before, because I don't get it, but I care more about consistency than being right.
So with my current colleague, I use "chore" as he does.
Another big difference is: I used `git worktree` extensively in my previous job. I don't now.
I used it extensively in my old job, since I maintained multiple long-lived contexts, and got distracted a lot.
I don't do that recently, so it's probably a work culture thing.
I don't use many aliases, but I do use that command a lot.
I point them at jujutsu (jj) and then they simply get on with using source control without the need for 8,000+ articles about navigating the insane Git command line interface.
Or select files by intuitively pressing + on them (or their folder), go through all the changes on the side.
From these threads it seems that I'm the only one who appreciates some UX and not having to type literally everything every time I've got to do something on a computer.
Regarding the formatting of commit messages: if everyone on your team is doing things slightly differently is something going wrong and what could fix it?
Is it a respect issue: people don’t follow a consensus because everyone is a headstrong individualist who refuses to play along with others?
Is it a communication problem? Are people just not intermingling in the commit message culture enough that they all naturally converge on a house style?
Is it a leadership issue? Are there no clear leaders in your engineering team who collude — consciously or subconsciously — to set the tone for everyone else?
Is it a technical issue? Without a pro-forma commit message template or additional tooling, are you failing your eng org by not giving them the framework / training wheels / guard rails they need to align on a house style for technical documentation?
I’ve been part of very healthy teams who largely ended up self organising into a consistent house style with a little help from tooling. I’ve also been part of unhealthy teams who fork themselves into multiple internal cliques that don’t intermingle enough to build up a monoculture. The healthiness of the teams might correlate with the commit message / commit graph style, or it might not. I wonder how it could be done better.
A lot of people don’t care enough. Likely someone will be on your team. And if they all care then it might still be the case that they won’t have a house style. Because it’s still well-written and legible.
Lots of successful teams literally dress identically (Real Madrid, Biles et al., Seal Team Six, Destiny’s Child) or at the very least have an underlying culture that joins them. An actual culture, not just a list of corporate touchstones, that you can visibly see either with a dress code or behavior.
Also we always squash merge so I don’t bother squashing my commits. Don’t review commit by commit.
This sort of dogmatic thinking is insufferable. Suggesting things is fine, insisting your way of doing things is the best way is really annoying.
Question for the author: when working alone on a personal project, what's the benefit of pushing every (minor) commit you've made?
pretty_git_log column: line too long * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * |\ | * | * | * | * | * | * * | * | |/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * > |\ | | * | * * |
Perhaps my commit messages are too long.