0

In an "integration manager workflow" scenario, should the public web directory be regarded as "maintainer private" git repository, or a canonical/blessed/upstream/main repository?

Since I would like to use git to push tested web applications coming from a small team of developers to the public server, is there a need for a read-only main repository?

Ate Somebits
  • 287
  • 1
  • 18

1 Answers1

0

You can create a repository(lets call it A) in which your development teams do not have write permissions. They will fork your repo to create a new repo(lets call it B). In this new repo B, they will push all their changes and when they are ready, they will send you a pull request to A, which when you accept will get pushed to A

prabodhprakash
  • 3,825
  • 24
  • 48
  • Ok, shoud I let developers fork from the "live" website, or a separate main read-only repository? And is it ok to have a live website as a repo? It seems quite practical to use git to push files to the website. – Ate Somebits Sep 29 '16 at 19:35
  • Actually, just realized that you cannot push to checkedout branch, and you also cannot checkout other branches on a production server, because that exposes those branches to the public, since the checkout procedure updates the working directory, which is the production server files. Now more confusion. – Ate Somebits Oct 10 '16 at 11:42
  • So, this is how I set it up in the end. The "maintainer" is also a developer, so I've created another development repo for the website. This repo, for some reason or other, is unable to push to the "remote" collaborator repo, but is able to push to the main repo. I've aliased the new dev folder on the server so I can use it for testing code. In case other developers want to contribute, I can simply pull the stuff from the "remote" dev repo (it's bare I guess). When things get tested, they merge into the master on the "maintainers" repo, and then get pulled in to the production repo – Ate Somebits Oct 11 '16 at 13:40
  • But my shell script for "pulling" the master branch of the maintainer repo doesn't work. I added a fetch command and a merge command, but it doesn't do it. However, the GUI operations do it fine. Do I need some special shell modifiers in case a want to write a separate fetch and merge script? – Ate Somebits Oct 11 '16 at 13:47