Live data from Hacker News

How Core Git Developers Configure Git

blog.gitbutler.com

71–80 of 129 posts

Re: How Core Git Developers Configure Git

#71

Some extra options I like: [apply] # Remove trailing whitespaces whitespace = fix [color "diff"] whitespace = red reverse [diff] colorMovedWS = allow-indentation-change [format] pretty = fuller [log] date = iso [pull] ff = only

I also use that color.diff.whitespace "red reverse" and along with it diff.wsErrorHighlight all. I recall needing to set both in the past but in trying to find out why that might have been superseded by only needing the latter. I'm not quite sure.

Re: How Core Git Developers Configure Git

#73
post #72

I’ve been practicing trunk-based development for the last year and none of these Git tips apply.

I'm curious what you mean. I've been practicing trunk based development since 2011[0] and all of these config settings help that flow. Arguably you don't want the rebase thing, but otherwise I can't imagine what you think here would not apply.

[0] https://scottchacon.com/2011/08/31/github-flow/

Re: How Core Git Developers Configure Git

#74
I also have this alias to my config

    [alias]
       lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue)%Creset' --abbrev-commit --branches
It shows a coincise colored graph of your commits and branches.

Re: How Core Git Developers Configure Git

#75

Earlier quoted context omitted.

While your comment is in jest, I agree with the sentiment. The whole "main" debacle sucks and, to this day, still breaks everyone's git usage.

Honest question: What has it broken about your git usage? I haven’t really noticed a problem. Sometimes a repo uses “main” and sometimes “master”. It’s not like “master” was the only option before

I personally haven't had a lot of breakage because my scripts never hardcoded the name of the master branch — it's possible to determine it on the fly or avoid using it. So for me it's simply the wall of useless text that wasn't there before ("using master as the name for the initial branch...") in every CI job and on every fresh system.

It's not really a major issue, but the way this "problem" was created and then forced onto the rest of us by someone with very strong opinions — but zero actual technical accomplishments in git development — is annoying, that's all. And it keeps reminding you of itself — see the first paragraph.

Re: How Core Git Developers Configure Git

#76

Earlier quoted context omitted.

After using delta for a while, I'm going back to the regular diff view... it's not that it isn't good, but I'm constantly copying diffs (yes, I know I can generate patches) and the pretty output breaks that workflow. Also, when your terminal is a bit small it's a bit hard to see things. But it's really good software, I recommend anyone who's reading to give it a try.

IIRC if you pipe the output to, e.g, xclip, or redirect to a file it will give the original diff format. Not as convenient, but still workable.

Pipe through cat should work

Re: How Core Git Developers Configure Git

#79

I also have this alias to my config [alias] lg = log --color --graph --pretty=format:'%Cred%h%Creset -%C(yellow)%d%Creset %s %Cgreen(%cr) %C(bold blue) %Creset' --abbrev-commit --branches It shows a coincise colored graph of your commits and branches.

I have something almost identical, except for the `—-graph` part. That way I have the flexibility to get either the linear view or the graph view by adding that single flag.
Post reply on HN