Using Git to improve workflow

I’m looking into ways to improve workflow for multiple developers on a webserver. Git is currently the most promising method at the moment to help track changes to files etc. but I have a few questions.

Firstly I am currently running an Ubuntu VPS with Apache 2 installed and I’m not sure what would be better; either renting a second cheap VPS and setting up a private git server on that or just storing all our files on GitHub. I get that using GitHub would be cheaper but I’d prefer to not have all of my work out on the public domain.

Secondly if I went down the road of using git how would I be able to only allow users access to edit certain files at a time rather than have access to edit every file on the server.

These are all interesting questions. Let me see what I can answer for you …

First, I want to correct what appears to be a misconception. You say,

I’d prefer to not have all of my work out on the public domain.

Public domain is a legal concept, one you specifically have to opt into. Simply posting something publicly doesn’t put that content into the “public domain” as a legal concept. If you’re meaning “public domain” as in “anyone on the Internet can see it”, that’s something different. We typically just call that “public”.

Did you know that GitHub offers private repositories as well?

As far as access rights go …

With GitHub, access is typically controlled mostly at the repository level. People would have the ability to read, write, or administrate a repository. But even if they only have the ability to read the repository, they can typically submit a Pull Request … which is a request for you to pull their changes into your repository. So they wouldn’t have access to do anything unless you (or your designees) approved it.

There are multiple security configurations that are designed to enable certain workflows. If you can give more details about the kind of workflow you’re envisioning, perhaps I can point to some more specific documentation.

And finally, just because someone has access to a repository, doesn’t mean that they’ll be able to change everything on the server. You control what gets checked into the repository. Maybe you only put certain directories into various Git repositories that are available via GitHub. It’s really a pretty flexible system.