I've written a program that clones and pulls lots of git repos (to try to estimate time spent on projects) and also serves as a website to present data. The program is written in C# on using Visual Studio for Mac and runs fine locally, but I'm having trouble when deployed onto an Ubuntu 16.0.4 machine.
The program runs as the www-data
user. It needs to be able to do two things:
- Create directories
- Do
git clone
andgit pull
on those directories over HTTP.
My problem is to do with permissions. When the new directories are created, they are owned by the www-data
user. I've set up a global credential store to put the necessary git credentials to access the repos, but that's created under my ubuntu
user.
I've tried fiddling with the visudo
stuff so that the www-data
user can execute the git
commands as the ubuntu
user, like the last answer here, but that still leaves me with a folder permissions problem.
I've read a bunch of similar questions on this, and they all seem to include a step where you manually change the folder permissions where you're storing the repository. However, in my case the folders get created on the fly.
Any help would be appreciated.