So I'm curious to hear what some of you out there would do under this type of a scenario.
Myself and another developer took over the ownership of a website from an outfit that had been handling it for some time. The company that had been handling it honestly had a lot of work on their plate, so they weren't able to put the time into the site that the owner needed. After some discussions with that company and the owner of the site, the development of the site was passed over to us.
I am a major proponent of using source control. However, I've never set up a web project under source control before. I know I could go down the road of Kiln/Git/Mercurial, but honestly, for what we're doing with this project, I just need the ability to keep a basic history of changes made within the site. No need for multitudes of branches with 30 developers hitting it.
So honestly, I've really just looked at using SubVersion, and using one of the free services available out there to host the site source. My question is this though.
When I think about hosting my source, I know in particular environments (PowerBuilder, Delphi, .NET), which directories get included. Which files get included, etc.
On the web side, I'm just not sure. I've been looking through things online, but just can't seem to find documentation that covers which each directory is for, etc.
So I have the following directories off the root of our web project...
As for the work I've done up till now, currently I've just had filezilla hitting our site. I've made my changes, and pushed them up to the live site.
THIS IS A RECIPE FOR DISASTER!!!
All my work I've done has been in the public_html directory. However, I'm not sure if I should place the rest of the directories in source control as well. Or if they are more dynamic and they change based on things that are updated in the cpanel.
If anybody possibly has some links to information on this, or could just pass some pointers onto me, I would really appreciate it. I know my goal of course is to run the entire site locally. Do all my work there, and after testing, check it into source control and push it up to the site.
Any thoughts anybody might be able to pass onto me would be greatly appreciated!!
asked Aug 04, 2015 at 05:44 AM jeffgibson 0
You should really look into Git. It's a very flexible environment and there's lot's of info on how to use it on the web. I've used both git and SVN for many years, and I like it way better the SVN for a number of reasons. It's also the #1 choice of most web professionals.
answered Feb 10, 2016 at 10:08 PM cbad 1
You're basically in control. There's a special hidden file named .gitignore that allows you to exclude anything from the repository. It goes into the root of your project and is honored recursively. So you might include:
This would then exclude all bak and log files and everything in the folder private-stuff.
.gitignore also has scope. So the one in your root folder applies to every folder in your project. But if you have another .gitignore at some lower level, it only applies from that point forward. It's really pretty powerful.
Plus you control it by what you decide to add to the repository. So if you never add a group of files, they aren't included in the repository. Trusting this can be somewhat open to human error, of course, but it still works. It's all pretty much common sense, but very flexible.
Hope this helps.
answered Feb 25, 2016 at 05:08 PM cbad 1