Live data from Hacker News

Conditional Git Configuration

blog.scottlowe.org

1–10 of 73 posts

Re: Conditional Git Configuration

#5
man git-config, shows that so far there aren't many conditions available for testing. The location of the .git directory (as in the article). The name of the currently checked out branch. Or a pattern match against any remote URL in the configuration.

Re: Conditional Git Configuration

#9

Oh nice, this will remove an annoyance in my dotfiles repo by letting me share my gitconfig between 3 different configurations (home linux amd64 box, work macOS arm64, client macOS arm64) Thank you for sharing it!

I just have a "config-private" file that I include in my main config, but I ignore it in the dotfiles repo. Git will ignore any included file if it does not exist. That lets me customize things locally without checking work details into version control.
Post reply on HN