Header support -c flag

Due to some security changes, I have to utilize the -c flag on the GIT commend, to add variable headers.

I can do this via the raw command line, but is there a way to configure this so either:
a) It is global and I don’t have to add it every single time
b) configure GitHub Desktop so it adds it each time it issues a git command in the background.

Hi @ebonovic does git-config - Get and set repository or global option work achieve what you need?

You may already be familiar with this from setting up your local git environment user and email details like

$ git config --global user.name “Your Name Comes Here”
$ git config --global user.email you@yourdomain.example.com

it mentions

http.extraHeader

Pass an additional HTTP header when communicating with a server. If more than one such entry exists, all of them are added as extra headers. To allow overriding the settings inherited from the system config, an empty value will reset the extra headers to the empty list.

Reference: git-config

Thanks @byrneh… So got a chance to try this today… and the problem I am seeing, is that I can only add ONE http.extraHeader, and I need two. and I can’t find the right formatting to get both entries into the same parameter.

To quote the http.extraHeader documentation:

If more than one such entry exists, all of them are added as extra headers.

So don’t put them both into one parameter, add the parameter twice.

When I tried that… only “one” showed up when I listed all the parameters
The later submitted one, wrote over the first one

Okay… so bypassing the command line “connivence” commands, if I go and manually adjust the .git/config file (local repository)… I was able to add more then one line

1 Like

@ebonovic , glad you are sorted. The documentation also states

http.extraHeader
Pass an additional HTTP header when communicating with a server. If more than one such entry exists, all of them are added as extra headers. To allow overriding the settings inherited from the system config, an empty value will reset the extra headers to the empty list.