Where should I host my git repository? (2017 edition)

Do you care about your code?

If you don’t care about your code (e.g. it’s an experiment, it’s a scratch project, etc.) there’s no reason to bother with git hosting. In all other cases, find somewhere to host your code aside from your development box.

Is your code public?

This question alone drives most of your decision making for git hosting. Do you plan on making your code public? Is it code for

  • a class?
  • a hobby?
  • a hackathon?
  • an open source project?

If you’re planning on building a business around it (unless it’s an open source business) then you might want to keep your code private.

Is your code open source?

Are you planning on releasing your code so that others can use it, modify it, or help contribute changes into it? If so, you’re done making decisions — go with github. They’re the preeminent open source hosting service and are seen as a defacto way to develop a reputation in the open source community.

Yes, that logo is an octocat

Are you willing to pay for hosting?

A lot of software firms are built on an open source foundation; typically they give back by providing free services to open source projects. For example, github provides free hosting; jetbrains provides free IDE licenses.

However, once you get out of the open source realm, you may need to consider cost in your hosting equations. As of April 2017, here are the costs:

Github — Private repos on github will cost you $7/mo for one person. If you have a team, you’re looking at $9-$21/mo depending on the size and features you need for your team. See the Github pricing page.

Bitbucket —Bitbucket supports two different models: cloud and server. If you’re going with the cloud hosting, then it’s free for up to 5 users on a team. If you’re more than 5 users, then it’s $1/user/mo. See the bitbucket pricing page. You also have the choice of hosting bitbucket “on premise” (a place you manage and own) in either your data center or cloud. Check out the host on your server pricing page for more info.

GitLab — Currently it’s free for unlimited public and private repos with unlimited collaborators. Sounds like a great deal, but it doesn’t include merge request approvals. For those, you’re looking at $39/yr/user. See the GitLab pricing page.

Are you working by yourself?

So you don’t want to pay for hosting — totally understandable for a side project, hobby, etc. If you’re planning on working with less than 5 other people on your side project, then let’s get on with coding and go with bitbucket (cloud edition).

User Bitbucket Cloud for free private repos with up to 5 collaborators

Do you want PRs?

Pull Requests (PRs) are a nice mechanism for reviewing code contributions. If you’re planning on working in a team, it’s a fantastic way to comment, coach, mentor, touch up, police, and otherwise make code better before it is accepted into a branch.

If you’re planning on always working alone and you don’t want to worry about PRs, then go with a local git repo with the directory synced via Dropbox. Check out Using Dropbox as a Private Github.

For when you want to backup but not collaboration

If you think you might collaborate with other people, then choose bitbucket (cloud edition).

Are you willing to manage your own git server?

Ok, now we’re moving out of the realm of easy and into the realm of “I need to host my own git server because I have control issues.” This is most likely a concern regarding security, though you’ll occasionally see a red herring argument about cost being a driver. Forget the cost argument, as the person-hours you’ll need to maintain a git server will usually dwarf your monthly expenses for a cloud hosted git repo.

For security, the typical argument is like my PB&J’s from grammar school — “we want to make sure no one else can touch it”.

Are you an Atlassian shop?

So at this point, we’ve decided we don’t want to host a server, but we are willing to pay for hosting. From a cost perspective, both bitbucket (cloud) and GitLab (cloud) are options.

So what’s an Atlassian shop? That means you’re running some combination of the following:

  • Jira — ticketing system
  • Confluence — team wiki
  • HipChat- team chat and video
  • Trello — kanban boards or a whatever-you-want board

If you’re running more than 2 of the above, go with bitbucket. It’ll tie into that ecosystem better and feel like you’re using a more integrated set of tools.

However, if you’re not using much of the Atlassian suite, take a look at GitLab as their pricing is competitive and they do have some nifty features included (e.g. integrated Continuous Integration and Continuous Deployment).

Will your team riot if it’s not Github?

There’s a lot of love for Github due to their support for open source. It may be that your team prefers it due to working on it in their open source projects. If so, Github Enterprise is certainly an option. Most enterprise offerings will be about control and security (e.g. SAML support, access logs and auditing, etc.). See the other features of Github Enterprise.

Are you an AWS shop?

A fairly new option is AWS CodeCommit if you’re a AWS shop. It’s free for the first 5 users (storage will cost you if > 50 GB), and $1/user/mo for every user after the five. See the CodeCommit pricing page on AWS.

I’m fairly sure a UI is coming that will make it more competitive with the other hosts identified above. If you’re using AWS for your app, this may become a no brainer down the road. As of right now (April 2017), it’s nice for a few things (e.g. Elastic Beanstalk deployments) but otherwise you’re riding the extreme edge and it’ll feel like it.

Are you a Google Cloud shop?

Finally, if you’re running in GCP, they too have Cloud Source Repositories but other than for a GCP deployment, it is a beta release right now and feels very beta. See the page describing Cloud Source Repositories.

Show your support

Clapping shows how much you appreciated Frank Blecha’s story.