Say I have two directories in home (~/) that contain git projects: repo-work
and repo-personal
. In repo-work
, I have work related git projects, and in repo-personal
, I have personal git projects.
I know you can configure git settings locally, globally, or system-wide. Local setting will require not setting global, and setting git configurations for each project, which seems like a hassle.
I can also set global git configurations for either work or personal, and change the local settings for each project of the other repository, but if I forget to do it, my git history gets mixed with my work email account and personal email account, which is a bigger hassle.
Ideally, I would want to have a "directory-specific" settings so that if I set settings for repo-work
, all projects under that directory will carry that setting, and likewise, for repo-personal
, the projects under that directory will carry personal git configurations. How can I achieve this?