-2

A colleague and I are going to be working together on a single project for the first time. This raises a few technical questions for me. Like how.

I think a version control system is a must now, if it wasn't already as a single developer.

But this also means that I can no longer simply upload to a development server via SFTP up on hitting CTRL+S. So I suppose this is where CI (continuous integration) comes in?

This also means choosing between SVN, GIT, Mercurial. Reading into those options it seems the world is divided. Each has their pro's and cons.

We do want to keep everything on-premise though, we know that much.

Currently I'm thinking of this:

PHPStorm
dev one ----\        Server              Server          Server
             ------- Development ------- Staging ------- Production
dev two ----/        Internal            External        External
                     |_ GIT (VCS)
                     |_ GIT hook (CD)
                     |_ Apache, etc

I'm wondering if there are experienced developers around that can share some of their ideas and knowledge on the topic.

update (2 days later): After weighing VCS's we went with GIT instead of SVN. TeamCity gave some challenges concerning compatibility with our network, so for now we went with a simple GIT hook for CD. We will look into CI some more later.

With GitList copied to an intranet site, we also have a nice on-premise lightweight web GUI for GIT. This makes it easy to keep track of projects and pushes outside of IDE's.

  • Really tough to respond to this in this forum. A lot of good questions, of course. You can find input for some of them by searching here. For example, a search on "Staging" gives you. a bunch of questions and answers about staging vs. production systems. A search on Git shows you what kind of questions people have been asking about Git. Mining questions and answers for insight can help if you are willing to invest the time. – joshp Sep 1 at 17:02
  • Not tough if you know the history of GIT. It was made to solve the problems created by other version control systems. Just use GIT. When you research how to use GIT all of the questions you asked will be answered through learning the system as it was designed for exactly your use case. – HackSlash Sep 1 at 17:13
  • Git was made to solve an entirely different set of problems to a small team collaborating in house - however it is the de-facto standard. Nor will understanding git (if anyone ever does) resolve all the other issues. Use git because its universal and portable, the rest is much more fun. – Murph Sep 1 at 17:47
  • Thank you for your time so far. I wonder why this post is downvoted, is this not the right place or right question? Anyhow, I do appreciate the answers so far. I will take them under advise. – JaredNinja Sep 1 at 17:57
  • 1
    Currently, 95% of the questions on this site are downvoted. IMHO part of the community is way-too trigger-happy with the downvote button. Said that, this question has some flaws: trying humor is not a good idea, distracting phrases like "Thanks" or "We are excited", or "I hope this is the right place to ask" are not well received. I would heavily recommend to edit all of these noise out of the question. Moreover, recommending specific tools (like which VCS you should use) is 100% off-topic for this site. – Doc Brown Sep 1 at 21:41
3

A version control system is a must now, if it wasn't already as a single developer.

It was. A VCS is mandatory for a team of one developer or more. It is so simple to set up, thanks to GitHub and similar services, that there is absolutely no excuse not to have one. Even if you're working on your own on a project, you should version your code, because:

  • You can just do something wrong with the code, and discover it only once in production (even if you have a lot of tests). In this case, without VCS, you're on your own to figure out what exactly you modified and how you can recover the working version (all this under pressure because the application is not working on production).

  • You can find yourself in a situation where you started something, and discovered that you're on a wrong track, the only solution being to erase all the changes.

  • The business may need you to do a modification fast, while you're working on another feature. With a VCS, you just stage your changes, work on the modification, and then go back to the state where you were interrupted. Without, you'll have to do it manually, and you'll likely make a mistake and lose code.

But this also means that I can no longer simply upload to a development server via FTP up on hitting CTRL+S.

Why, was it what you did until now? This creates another series of problems, and means that humans interact directly with the servers. This creates a risk of losing those servers at any moment, because humans are prone to errors.

I suppose this is where CI (continuous integration) comes in?

Or, in your case, continuous deployment. Essentially, as soon as you commit something, an automated process runs the basic checks (such as style checking), then runs the tests (which can be a multi-stage process depending on the number of different types of tests you have), and if everything looks good, deploys the changes to production.

If you want to keep is simple, you can do it with a simple script. Or you can use a complete product which does that for you, if you know how to use it.

This also means choosing between SVN, GIT, Mercurial, etc.

Just pick one. The choice is not that important. Someone in the comments recommended Git; it is indeed a perfectly valid option, and comes with lots of tools, including GitHub Desktop, if you're using Windows or MacOS; the huge benefit of GitHub Desktop is that it hides a lot of Git complexity and is therefore very practical for the beginners. Also consider GitHub, which is one of the most popular hosting services for the source code, including private repositories.

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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