Unless the project is really huge, I'd go for single repository with subdirectories for server and client and create a branch for each version. You can still have multiple copies of the repository in case you want access multiple versions at the same time.
By maintaining multiple repositories, you'd make transferring changes harder than necessary (rebase is easier than applying patches). In the (improbable) case there'll no changes to be applied to multiple versions, you still lose nothing...
Moreover, you can always switch to multiple repositories: Just clone the repo and remove the branches you don't want. Going the other way round is harder.
I'd go for multiple repos only if the server and client share nothing or if the code is really huge.
Your plan sounds great! I think you are off to a really good start.
My only advice is in regard to you Developer Workflow. I think you're dev
branch may become problematic, because developers will be merging code willy-nilly then they think its ready.
If both branchA and branchB, C, and D are merged into dev
, and it fails, you can't be certain which parts are necessarily failing. Also, if someone pushes up something with a conflict, you dont know who it was. Madness and insanity are bound to ensue.
If a feature turns out not to be ready, and code needs to be backed out of dev
, other developers will have already pulled down their additions. Those developers then will merge back into dev
, unwittingly re-introducing the broken code. Madness and insanity are bound to ensue.
You're going to need a couple steps of separation to keep untested code away from tested code.
This all depends on the skill sets of your team, and how you actually work together. What follows is my solution to problems of a quickly expanding team with differing levels of git knowledge and different levels of developers code dependability.
I always try to tell people to not simply think about developer workflow, but testing procedure, and release process. They all need to be planned as part of a singular process.
- Lead Dev or Release Mngr (whoever) creates a new
release
branch based off master
. This branch will be a container for anything going on it in the next release.
- Lead/ReleaseMngr creates
integration
branch based off release.
- Developer creates new feature branch (or topic branch, whatever you want to call it), based off the current release branch.
- Developer tests locally, is happy.
- The developers feature branch deployed somewhere and tested by QA independently of any untested code.
- QA signs off on feature - it gets merged into an
integration
branch. (ideally, IMHO, only after the feature branch has been rebased off release
, to force the conflict resolutions )
- QA tests the
integration
branch which is just the release
branch + this one feature.
- QA signs off - integration is merged into release (if not signed off, integration is blown away and recreated based on
release
). This is the reason for integration
. No one pulls form this branch, and it can be blown away as needed.
- Now the feature is in release, and can be shared with other developers making features based off
release
branch.
- Release is good, merge to master. Deploy, make a new release branch based off master.
I know it sounds like a lot, but it really will save you from the headaches and, in my experience, are inevitable with large projects with logs of people having differing levels of knowledge.
If you have a small team with a simple release process, or a team that is very experienced - all this may not be necessary - but do be aware of the inherent problem with testing multiple people's code at the same time in your dev
branch.
All that said, its my understanding the GitHub team just lets everyone merge into master directly (after a brief code review) and auto deploys ~30 times a day.
Best Answer
As the code is going to be the same or versions of the same code, it would be healthier to have a single repository and several branches, one for each purpose. If you are in doubt on which branching scheme to use, there are many proposals out there (i.e. git flow).
As with git is so easy to port stuff from one branch to the other and back in the same repository, having separate repositories will give you a lot of headaches.
Additionally, you can have two branches on a repository that have completely different content, like for example the Bootstrap project: their code is on master branch and the github documentation pages are on another one.
And with Amazon Beanstalk you have to specify the branch you want to push to each environment, to this won't be a problem.
Git is so flexible you'll love it.