1

Is there a way to enable git to use specific users on the system when running as root on a per repo basis?

Repo1 when run as root files would be owned by 1000

Repo2 when run as root files would be owned by 2000

and so on..

5
  • What are you actually trying to accomplish? Commented Jan 23, 2012 at 19:10
  • 1
    What is the larger problem you are trying to solve? This sounds like you should have a script. You can always run as another user with su - someuser -c "/somecommand.sh". Alternatively, use sudo as it might be a better fit for your problem. Commented Jan 23, 2012 at 19:12
  • @Jefromi I'm trying to make all the files owned by 1000 instead of root, when Git creates new files from a pull or merge. Commented Jan 23, 2012 at 19:29
  • So the question then is... why are you unnecessarily running as root instead of that user? Commented Jan 23, 2012 at 19:30
  • @Jefromi - I could su into 1000, but I'm looking for a way that git would handle it. Commented Jan 23, 2012 at 19:41

1 Answer 1

2

No. You could have a local wrapper for git that would add this behaviour in the path ahead of the normal tools, though, which might better achieve your goals.

Sign up to request clarification or add additional context in comments.

1 Comment

Or you could just switch users. Running things unnecessarily as root is kind of asking for trouble.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.