Live data from Hacker News

How Core Git Developers Configure Git

blog.gitbutler.com

11–20 of 129 posts

Re: How Core Git Developers Configure Git

#11
post #4

Wow this is neat. I never really bothered to deep-dive into my git configuration, but some of these are really cool. The diff changes are awesome, and I always wondered why there isn't a global .gitignore file in the first place, seeing that every .gitignore file basically has (mostly) the same content

I mentioned it in the post as well, but Git will look in `.config/git/ignore` if you prefer to just use that rather than setting a new path. There's also a possible downside here in having things hidden for you but not for others since it's not in your `.gitignore` project file. I'm honestly kind of on the fence about this one, I don't have much in that file for those reasons.

I have .DS_store in mine, as I'm on a Mac and don't need to spread that to others.

Re: How Core Git Developers Configure Git

#13
post #4

Earlier quoted context omitted.

I mentioned it in the post as well, but Git will look in `.config/git/ignore` if you prefer to just use that rather than setting a new path. There's also a possible downside here in having things hidden for you but not for others since it's not in your `.gitignore` project file. I'm honestly kind of on the fence about this one, I don't have much in that file for those reasons.

I have .DS_store in mine, as I'm on a Mac and don't need to spread that to others.

Good point.

Re: How Core Git Developers Configure Git

#14

Wow this is neat. I never really bothered to deep-dive into my git configuration, but some of these are really cool. The diff changes are awesome, and I always wondered why there isn't a global .gitignore file in the first place, seeing that every .gitignore file basically has (mostly) the same content

There's also an ongoing effort among creators to not pollute the home directory with too many hidden files. Instead, as the blog post mentions, there exist .config/git/ignore which I think is a more scalable approach in the long run. Especially looking at the number of tools and utilities requiring one or several config files.

Re: How Core Git Developers Configure Git

#15
post #9

How much of this is for a noob like me that just uses vscode? I hardly ever see the git command line, and when I do see it, its trouble beyond what anybody can fix...

Nothing wrong with a gui. Esp with git imo. The process doesn’t require blazing fast agility, but careful review and selection.

Graphical diff viewers are way better anyway.

Re: How Core Git Developers Configure Git

#17

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 did almost put `log.date iso` in there, I like that one too.

Re: How Core Git Developers Configure Git

#18

> Default branch > Personally, I don’t have a problem with master > updating the default value. I wish Git had some taste here, but they don't So author has no preference, but git does not have a good taste here, for not breaking backward compatibility. Typical passive agresive bullshit! I think "main" is not inclusive enough, we should use something like "non-specific-but-strong-branch". Or something that includes e…

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.

Re: How Core Git Developers Configure Git

#19

Wow this is neat. I never really bothered to deep-dive into my git configuration, but some of these are really cool. The diff changes are awesome, and I always wondered why there isn't a global .gitignore file in the first place, seeing that every .gitignore file basically has (mostly) the same content

$XDG_CONFIG_HOME/git/ignore

Re: How Core Git Developers Configure Git

#20

Wow this is neat. I never really bothered to deep-dive into my git configuration, but some of these are really cool. The diff changes are awesome, and I always wondered why there isn't a global .gitignore file in the first place, seeing that every .gitignore file basically has (mostly) the same content

I prefer difftastic ( https://github.com/Wilfred/difftastic ) as diff tool. I think it's the most readable and understandable diff.

At the end of the article, I also subtly plugged:

* https://github.com/so-fancy/diff-so-fancy

* https://github.com/dandavison/delta

Also both great TUI diff tools

Post reply on HN