Is it possible to configure user.name and user.email per wildcard domains in .gitconfig?

前端 未结 5 457
不思量自难忘°
不思量自难忘° 2021-01-31 03:00

I have a work computer, and it\'s configured globally to use my work email and name when committing. This is good. However, I\'d like to make some sort of rule that says, \"if t

5条回答
  •  春和景丽
    2021-01-31 03:17

    I wrote post-checkhout hook to set the repo's local author details based on the repository's origin URL.

    It doesn't do wildcard domains, though it makes use of git config --urlmatch which allegedly will fall back to the closest matching URL.

    Check it out here: https://github.com/boywhoroared/dotfiles/blob/master/git/template/hooks/post-checkout.d/author

提交回复
热议问题