Live data from Hacker News

How Core Git Developers Configure Git

blog.gitbutler.com

81–90 of 129 posts

Re: How Core Git Developers Configure Git

#81

Earlier quoted context omitted.

I... did not know that! Yep yep that should do the trick for me. Thanks a lot, actually!

Most tools that do formatted output, if they’re well-behaved, should try to detect if their output is a pipe and if so, disable formatting. Some examples that I can think of off the top of my head (in addition to git) are ripgrep and jq, both of which do the right thing and strip formatting.

rather they should detect that output is a terminal and enable the coloring

Re: How Core Git Developers Configure Git

#83
post #34
post #30

Earlier quoted context omitted.

Shortened aliases come from cvs/svn land, sorting tags by a logical manner, adding some extra archive types for "git archive", making it so git log always shows my local time zone, pull will never do a non-ff merge, make it so Git doesn't complain about repositories in places it doesn't like, turning off an annoying message about a detached HEAD state, and shut git up about the default branch.

Yeah, I didn't do aliases on purpose, because I wanted everything to be fairly global, where I feel like aliases are more personal. But yes, aliases are great.

as for me, I want something more. Like git shell. Where I no need to write git, git, git again and again. Strange that there is no something like this yet.

Re: How Core Git Developers Configure Git

#85

I discovered that you can have git use the pager you like so I set it to my darling : bat git config --global core.pager bat https://github.com/sharkdp/bat/

You can also do that with delta (https://github.com/dandavison/delta), with additional options that you can put on your .gitconfig

Re: How Core Git Developers Configure Git

#86
post #66

Earlier quoted context omitted.

Wow I never knew this, I always just type `--no-ext-diff` when piping the output. Thanks!

`... | cat` is sometimes really handy (and universal)

I use git -c core.pager = less, but piping seems to be a less verbose option... hmmm I'll try it

Re: How Core Git Developers Configure Git

#87
post #67

# clearly makes git better If these options clearly make git better, why aren't they the defaults?

The default rarely change avoid breaking changes.

It would be nice to have modern defaults protected behind a single option.

defaults = 2025.01

Or whatever.

Re: How Core Git Developers Configure Git

#88
post #80

My favorite alias is `git out`, which just lists all unpushed commits. I use it all the time. [alias] out = "log @{u}.." In my head I always hear it in the voice of The Terminator: https://youtu.be/8cdC1Y5oRFg?t=54

I should do another article on the best aliases, because this is a great one. I want it just because I want to do the Arnold voice every time.

Now I want to do: `git to-da-choppa`

Re: How Core Git Developers Configure Git

#89
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...

I wouldn't like to be this kind of person, but, in the case of git, the best you can do you is forcing yourself little by little to use the Git CLI. It's far from being beginner friendly, but it shows the things the way the really are. GUI git tools hide things under their hood, which is ok for most cases but when you need a little more complex thing you are limited to their capabilities.

For instance, I wrote this post last year about how you can use Git as a powerful debugging tool: https://news.ycombinator.com/item?id=39877637

Re: How Core Git Developers Configure Git

#90

I discovered that you can have git use the pager you like so I set it to my darling : bat git config --global core.pager bat https://github.com/sharkdp/bat/

Is there an advantage to doing this over setting the GIT_PAGER environment variable?

(Weirdly, git doesn't seem to honour the PAGER var (which would be even better), although its man page claims it does)

Post reply on HN