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
  • 15,603
  • 58
  • 186
  • 303

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,262,500
  • 529
  • 4,410
  • 5,250
  • 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