1

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?

THIS USER NEEDS HELP
  • 3,136
  • 4
  • 30
  • 55
  • [Set git config values for all child folders](http://stackoverflow.com/q/21307793) – Basilevs Jul 25 '16 at 19:42
  • @Basilevs The second link question is very similar to mine, but it seems like there is no clean way to do it. I don't have too many personal repos, so I might just globally set it to work email and set personal repo individually. I will wait for a few more days and close this question. – THIS USER NEEDS HELP Jul 25 '16 at 20:36
  • @THISUSERNEEDSHELP see my response here https://stackoverflow.com/questions/21307793/set-git-config-values-for-all-child-folders/37167110#37167110 for exactly the same problem, I had. – Ajay M Feb 07 '18 at 19:26

0 Answers0