Reputation: 61
I've been using Git for over a year now, but I feel that I need to fine tune my workflow. Hope you can help! Right now I have 5 computers:
3 DESKTOPS/DEVELOPERS: Where we do all the work and when we're happy with the changes we push them to the webserver.
WEBSERVER: The webserver receives the pushes and then it has a hook to automatically check them out (so they become live directly once we push from a desktop). This is the central unit that all computers use to push to and pull from.
BACKUP: OK, I don't have this yet, but I'm planning to install one. Need some advices first.
Some questions about all this:
Of course, sometimes images etc gets uploaded through Apache directly on the webserver. We don't receive these files on the desktops unless we do a manual add and commit remotely on the webserver. Would it be a good idea to have a cronjob that does an add and commit automatically every night on the webserver?
I'm planning to install an backup server for the websites. First I was looking at Rsync and rdiff-backup but then it hit me that maybe it's better to use Git. Then I will also have a history with all commits. Would that be a good idea? If so, do I just make a cronjob with git pull?
Some repositories are becoming very large due to deleted and cached images. On the desktops and the backup server we have plenty of HDD so that's not a big problem, but HDD is very expensive on the webserver. Would it be possible to automatically delete and reset all deleted and cached files on the webserver every night, but still have the full history on the desktops and backup server?
Upvotes: 4
Views: 251
Reputation: 70763
These are a lot of questions. Most important answer: Do not store your dynamic images in git. This is not what git was designed for and is generally a bad idea. That also answers question #3: no, that is not possible. Only store images in git that are part of your code/site.
Regarding Backups: It does not seem like your code needs any more backups. You already have 4 complete copies of your code on different machines in different locations. Unless your want another backup in a fireproof bunker, I don’t think there is a lot of room for improvement :).
If you want the dynamic images from the server on your clients write a script that syncs them via ftp.
Upvotes: 2