Git
GitHub

Publish Git | .gitconfig to your Github repository! (use the .gitconfig include)

Configuration files tend to be "secrets of secrets", but how about publishing more and more!

However, I think there are also personal names, project-specific parts, and things that you do not want to disclose. So we use the .gitconfig include feature.


Public file

Apart from .gitconfig, create an include file in a directory of your choice and manage git. The file name may be anything.

For example, if you publish only the alias settings, it looks like this:

 [alias] ck = checkout st = status -s 


include

Include the above file from the .gitconfig body.

 + [include] + path = ~/my_configs/.gitconfig_for_include - [alias] - ck = checkout - st = status -s [user] name = yinaura email = example@email.com 


result

By doing this, you can manage the repository by making only "the part you want to publish" independent. You don't have to copy and paste public .gitconfig.

All you have to do is push to Github!


reference