Hacker News new | ask | show | jobs
by PunchyHamster 117 days ago
you can have per repo and per directory git config via git conditional includes

    [includeIf "hasconfig:remote.*.url:https://*.github.com/**"]
    path = /home/xani/src/gh/.gitconfig
1 comments

Quite nice. I had to split into two statements to make it work for both https and ssh because of a bug in git:

    [includeIf "hasconfig:remote.*.url:git@git.work:*/**"]
      path = ~/.gitconfig.work
    [includeIf "hasconfig:remote.*.url:https://git.work/**"]
      path = ~/.gitconfig.work