I'd like to include a file in my .gitconfig that has my github settings - is this possible?
Can I do something like this:
[core]
include = /path/to/file
Join Stack Overflow to learn, share knowledge, and build your career.
|
Git (1.7.10+) now supports this syntax in
See here for a detailed description of the git change and its edge cases. By the way, a couple of subtleties worth pointing out:
|
|||||||||||||||||||||
|
|
You may load it from the command-line:
Use After running above command, the following lines are added into your
|
||||
|
|
|
Update 2012: See Mike Morearty's answer: Includes
I do not think so. I would rather put that setting in the
That way, it completes the .gitconfig project-specific file, without being published when pushed to GitHub. See also this SO answer for more on the global config file. bjeanes adds in the comments:
A possible way would be to use a smudge/clean filter driver to decrypt/encrypt one file with private sensitive informations (see this thread), in order to complete a local file like ~/.gitconfig with the decrypted parts that are relevant to that file. That way you can have a Git repo with all your dot files, plus one file with encrypted information meant to be decrypted and added to said dot files.
In
In your repo .config file:
(a GPG-based solution means, off course, you have communicated your private/public keys by another mean onto the destination computer where you want to restore all your dot files by cloning this special repo) Actually, in your case, the smudge script needs to be completed as it must, after decrypted that file, go on and add relevant parts to your global https://kerneltrap.org/mailarchive/git/2008/3/13/1153274/thread (gpg inconveniences are discussed further in this thread) (this is different than having a full encrytped Git repo, as discussed here) |
|||||
|
|
I believe you can accomplish this using defunkt's hub tool. This is a wrapper for the git command which among other things, allows you to have Then to make it seamless the user you pointed to aliased **NOTE for homebrew users on OSX, you can install the tool via |
|||
|
|
~/.gitconfig), i.e. not pushed to your github repo. When you type 'git config', what you see is the concatenation of the 3 config file (repo, global and system). Only the repo config file get pushed. The 2 other ones stay local. – VonC Oct 13 '09 at 11:23