Quantcast

Propagating config to clones/pulls

classic Classic list List threaded Threaded
5 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Propagating config to clones/pulls

Douglas Tan
I have some config settings that I'll like to make default for anyone cloning/pulling from the central remote bare repository. I've tried to do this by editing the config file in the bare repository on the server but the change doesn't appear when cloning. How can I go about pushing default config settings to anyone cloing or pulling from the repository?--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Propagating config to clones/pulls

Thomas Rast
Douglas Tan wrote:
>
> I have some config settings that I'll like to make default for
> anyone cloning/pulling from the central remote bare repository. I've
> tried to do this by editing the config file in the bare repository
> on the server but the change doesn't appear when cloning. How can I
> go about pushing default config settings to anyone cloing or pulling
> from the repository?

You can't, since that would open a whole range of security issues.

You can put some config defaults inside the repository itself, but it
is up to your users whether they apply them.  Perhaps it's best to
write them as a shellscript that adds to the configuration file(s) so
that it is easy to apply it later, e.g.,

  #!/bin/sh
  git config diff.jpg.textconv exiftool
  cat >> .gitattributes <<EOF
  *.jpg diff=jpg
  EOF

--
Thomas Rast
trast@{inf,student}.ethz.ch
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Propagating config to clones/pulls

David Aguilar
On 9/7/10, Thomas Rast <[hidden email]> wrote:

> Douglas Tan wrote:
>  >
>  > I have some config settings that I'll like to make default for
>  > anyone cloning/pulling from the central remote bare repository. I've
>  > tried to do this by editing the config file in the bare repository
>  > on the server but the change doesn't appear when cloning. How can I
>  > go about pushing default config settings to anyone cloing or pulling
>  > from the repository?
>
>  You can't, since that would open a whole range of security issues.
>
>  You can put some config defaults inside the repository itself, but it
>  is up to your users whether they apply them.  Perhaps it's best to
>  write them as a shellscript that adds to the configuration file(s) so
>  that it is easy to apply it later, e.g.,
>
>   #!/bin/sh
>   git config diff.jpg.textconv exiftool
>   cat >> .gitattributes <<EOF
>   *.jpg diff=jpg
>   EOF
>
>  --
>  Thomas Rast
>  trast@{inf,student}.ethz.ch

Also.. if you happen to have administrator access to their machines
(or if they do) then you can roll an .rpm/.deb/etc. containing an
/etc/gitconfig and install it on their machines.  That'll apply these
settings globally without them having to run a script everytime a repo
is cloned.
--
    David
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Propagating config to clones/pulls

Neal Kreitzinger
In reply to this post by Douglas Tan
"Douglas Tan" <[hidden email]> wrote in message
news:[hidden email]...
>I have some config settings that I'll like to make default for anyone
>cloning/pulling from the central remote bare repository. I've tried to do
>this by editing the config file in the bare repository on the server but
>the change doesn't appear when cloning. How can I go about pushing default
>config settings to anyone cloing or pulling from the repository?--

Based on the assumption that your "child" repos are supposed to have the
same .git/config files, I tried using git-init --template=x with a config
file in template directory "x", but git-init only picks up the config file
on an initialization of a new repo, not on a reinitialization of an existing
repo.

v/r,
Neal



--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Propagating config to clones/pulls

Douglas Tan
In reply to this post by David Aguilar
Thanks for the suggestions, I think I'll have everyone cloning the repositories to add the configuration settings in ~/.gitconfig instead.

On 07/09/2010, at 7:05 PM, David Aguilar wrote:

> On 9/7/10, Thomas Rast <[hidden email]> wrote:
>> Douglas Tan wrote:
>>>
>>> I have some config settings that I'll like to make default for
>>> anyone cloning/pulling from the central remote bare repository. I've
>>> tried to do this by editing the config file in the bare repository
>>> on the server but the change doesn't appear when cloning. How can I
>>> go about pushing default config settings to anyone cloing or pulling
>>> from the repository?
>>
>> You can't, since that would open a whole range of security issues.
>>
>> You can put some config defaults inside the repository itself, but it
>> is up to your users whether they apply them.  Perhaps it's best to
>> write them as a shellscript that adds to the configuration file(s) so
>> that it is easy to apply it later, e.g.,
>>
>>  #!/bin/sh
>>  git config diff.jpg.textconv exiftool
>>  cat >> .gitattributes <<EOF
>>  *.jpg diff=jpg
>>  EOF
>>
>> --
>> Thomas Rast
>> trast@{inf,student}.ethz.ch
>
> Also.. if you happen to have administrator access to their machines
> (or if they do) then you can roll an .rpm/.deb/etc. containing an
> /etc/gitconfig and install it on their machines.  That'll apply these
> settings globally without them having to run a script everytime a repo
> is cloned.
> --
>    David

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to [hidden email]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Loading...