I'm a one-man band and I have a contract with a client to develop and maintain a web-based system that is relied upon. This is the first project of this size and type that I have done for anyone else so I'm still finding my feet a bit in that respect and I'm not sure on any standard practices.

The current situation is that the live system is hosted on a VPS and I have a copy of the system on my local Windows machine with MySQL and PHP installed so that I can develop new features locally and then sync the files with the VPS once I have finished them. This works great, however the complications come when there are any bugs in the system - at which point I'm not sure what to do?

At the minute, I've created another local copy of the system for the purposes of fixing bugs but whilst this enables to sync to the VPS without also syncing any incomplete features, that means that the version of the system which I develop features on still contains the bugs that I have fixed. The only thing I can think of to solve this is to manually copy any changes I made in the bug fixing version, but this seems quite inefficient and impractical once more than one person starts working on a project (which I hope will be the case soon).

I would appreciate if people could share their solutions to situations that may be similar to mine, as I appreciate that no situation is identical and that people may have different solutions to the same problem. For your information as well, I prioritise the fixing of bugs over the implementation of new features.

  • 1
    Are you using a version control system? – Dan Pichelman Oct 23 '15 at 21:39
  • No, unfortunately not! I wish I was but when I started this project I wasn't fully aware of version control systems and to be completely honest I still only now the basics, hence this question. :/ – Andy Oct 23 '15 at 21:54
  • 6
    You need to get on one NOW. The sanity you save will likely be your own. Yes, even single-developer projects should be in a version control system. Correct use of such a system (i.e., maintaining branches) is also the answer to your question. – Dan Pichelman Oct 23 '15 at 21:56
  • I thought you might say as much to be honest. From my limited knowledge I can definitely see the benefit of them, is it easy enough to put one in place part way through a project? – Andy Oct 23 '15 at 22:16
  • @Andy: adding a version control system is easy when you already have same stable structures in your project - which I guess is what you have. – Doc Brown Oct 24 '15 at 7:28

My suggestion would be to get a version control system that would allow for branching, e.g. Subversion and Git would both be free ones that can be used, so that you can have branches for features, bugs and releases so that you can revert your code to various states easily.

Here are some links to help with the basics:

Subversion link about branching: http://svnbook.red-bean.com/en/1.7/svn.branchmerge.html

Git link about branching: http://pcottle.github.io/learnGitBranching/

I'd put this in place ASAP as this allows for rolling back changes as well as being a reasonable way to move forward knowing which version has had which bug and what patches are applied for which branches, etc.

| improve this answer | |
  • Thank you for your answer. It certainly sounds like your suggestion is the best solution but as I have little experience with these systems, would it be possible for you to recommend any tutorials or videos please? – Andy Oct 23 '15 at 22:19
  • 1
    Also read on git-flow as a way to go about maintaining your branches. – andho Oct 24 '15 at 3:07
  • For a lone developer, Git is probably easiest to set up. Just google for something like "git tutorial" and pick one that seems easy to follow for you. – Bart van Ingen Schenau Oct 24 '15 at 8:47
  • @andho That link is absolutely fantastic, thank you. It has given me a much better idea of everything, I'll definitely be saving it for reference. – Andy Oct 24 '15 at 12:51
  • 1
    @Andy: Yes. Subversion only starts to be interesting when you want to have a master repository on a separate server. – Bart van Ingen Schenau Oct 24 '15 at 12:58

A version control system is surely what you need, but don't expect it to solve your problems automatically. You need to work with feature branches, and that can be additional effort, especially when merging bugfixes and new features. So I recommend also to learn how feature toggles work. That is an alternative approach (which works without version control), which sometimes causes less efforts, especially when you are developing a new feature with a small "entry point".

Note that feature branches and feature toggles both have some advantages and disadvantages, sometimes the former works better, sometimes the latter.

| improve this answer | |
  • Thank you for your answer - it pointed me in the right direction and I do like the idea of "feature toggles" which may work well for the time being, however I think that I would rather look at SVN now before the project gets too big and complicated as it is likely that the amount of toggles needed would be great and it may not work well if another developer joins me in the near future. – Andy Oct 24 '15 at 11:49

Not the answer you're looking for? Browse other questions tagged or ask your own question.