On my personal machine, I set my personal email address in my global git configuration.
$ git config --global --get user.email
steve@personal.com
However, I also have my company code, and so I need to configure git to my company email address.
$ cd corp/project
$ git config --local --get user.email
steve@corp.com
Sometimes, however, when cloning a repo, I forget to redefine my email address, and therefore I record the use of my personal email address.
It would be possible to delete my global git configuration, thereby preventing me from making any repos before installing user.emailin the local git configuration.
This is a bit of lavash, though, and in an ideal world, I could set up a hierarchical git configuration so that repositories in a specific subdirectory (or some other ways to develop which configuration are applicable) use the most specific installation in it.
Something like the following:
~/
|
+
|
+
|
+
|
+
|
+
|
+
AFAIK is currently not possible initially with git, this will require a new level of configuration, which is between global and local
Is there a way to achieve what I'm looking for here?
source
share