2

I'm working in an environment where the developers work directly with script and image files on the live deployment web server. This is scary and has caused a few, though so far surprisingly few, issues. Source control is not used at all for these changes, the changes are made on the live server and only on the live server. I don't know how to make it so that changes other developers have made on the live web server are kept/merged when I deploy my changes to the live web server. This issue would seem to make matters worse using source control rather than better.

I have personally setup git and svn servers, and used version control with git and svn for the past several years on many desktop app and mobile app projects. But this has me stumped.

timeSmith
  • 380

1 Answers1

2

Best practice is to use git as part of how you deploy. So much so that you'll find relatively few answers about other uses of git.

That said, git can be used in many ways. If your deployment is to the live server, and not from git, then there's still value in committing changes to git, so you can at least see what changed when, and roll stuff back. What you'll lose is sensible comments and grouping of changes into commits so that you can see where you want to roll back to quickly, and you can see what changes in different files are likely to be dependent on each other.

It is perfectly possible to let your live code be a git working directory, and you can have automated updates of the repository running every so often from cron.

etckeeper (https://github.com/joeyh/etckeeper) is in some ways comparable. It's designed for recording changes in a server's /etc directory, as opposed to a web site, but it's otherwise quite similar to what you have in mind. It'll probably have some useful ideas tucked into it's commit hooks and the like, but it's also complicated by covering several different VCS systems, and compatibility with multiple operating systems.

mc0e
  • 387