git/list[1] front-page[2] threads[3] people[4] search[5] about
 

How to prevent changes to repository by root

From
Nazri Ramliy <ayiehere@gmail.com>
Date
Jun 14, 2010, 03:12 UTC
Message-ID
<AANLkTikLixhYITdJKMFb3Hw2hZvaas1DtiV3x9ThCTZz@mail.gmail.com>

I have a git repository owned by a non-privileged user account on a machine that is logged into (via ssh) by multiple users. These multiple users, all of them (not at at the same time) do "git pull" on this repository.

Everything is fine as long as they don't do the "git pull" as root.

Murphy's law and all, someone is bound to do "git pull" as root on that repo and that would sometime cause problem for the non-privileged user (who 'own') the git repo to do subsequent git operations on that repository.

My question is:
How do I limit any action on this repository to this non-privileged user only?

I looked at "git help hooks" thinking that maybe I can use one of the hooks to add return "test $USER = foo" but from the descriptions there it is not clear which hook is the one that applies to this case (limit all repository action on this repository to this user only)

Any ideas?
Thanks in advance for any help.
nazri.
Next: Nicolas Sebrecht
Message 1 of 5 in “How to prevent changes to repository by root”
  1. Nazri RamliyJun 14, 2010
  2. Nicolas SebrechtJun 16, 2010
  3. Aneurin PriceJun 16, 2010
  4. Nazri RamliyJun 17, 2010
  5. Pete HarlanJun 18, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.