I have created a central bare Git repository managed by GitLab for our developers to push changes to. I have subsequently pushed a "test" branch to this central repository. Now I need to pull or export from this repository to a local filesystem to serve the "test" site files. I'd use the same flow for merging changes into staging and production branches.
What's the best practice way to set up my web server to pull the test branch (and only the test branch?) code down from the central repository to the local file system? Do I clone the repository? Do a git init
then git pull URL
? Is there any way to force this local file system to only ever update from the test branch or is that not good/standard practice?
Is it bad practice to serve files in a Git repository and should I be exporting instead?