0

I have some settings in my .git/config file. Now I would like my build server to pick up these configurations when it clones the job. But there is no .git/config file in the cloned repo on the buildserver.

How do I push changes from my local .git/config file to the server?

u123
  • 14,161
  • 51
  • 160
  • 272

1 Answers1

1

You don't directly: config are never pushed, for security reason.

You could version the part of the config you need, and make sure to manually add a git config directive in the server repo which would include your versioned config file.
See "Is it possible to include a file in your .gitconfig".

[include]
    path = /path/to/file

Then, the repo on the server would pick up any config modification you are pushing (since you would be pushing a versioned file, which would be included in the config of the remote repo).

Community
  • 1
  • 1
VonC
  • 1,129,465
  • 480
  • 4,036
  • 4,755
  • Ok so configs in .git/config does not have corresponding configs valid for .gitattributes (which is committed/pushed)? Then the configs could be read from that file instead. – u123 Dec 18 '14 at 08:56
  • @u123 yes, `.git/config` does not have corresponding configs valid for `.gitattributes`. You need to manage your config in a separate file (at least separate from `.gitattributes`) – VonC Dec 18 '14 at 09:11