Unlimited free private/public repos with Gitlab
A couple weeks ago I was introduced to a application called Gitlab, and I must say, I love using it. For those of you who don't know, Gitlab is a self-hosted alternative to Github. It has almost every feature Github provides, and a couple features that Github doesn't have.
Awesome Stuff
Possibly the best thing Gitlab provides, is the ability to have unlimited Private & Public (private by default) repos, for free. Then there is stuff like user/repo management, service hooks, a nice GUI, Team management, wiki support, and of course, Gitlab is open source.
Drawbacks
While I think Gitlab is simply fantastic to use, setup is another story. While I was installing on Ubuntu Server 13.02, I ran into several issues that required me googling around, in order to solve them. 2 specifically annoying problems were:
- One of the config files was located in a specific branch but the instructions used the Master branch version of the file.
- When adding the ssh info to your local git repo, you need to use the servers absolute path to the repo, and not the path shown in Gitlab.
For the second problem, I haven't found a "complete" solution, but it is entirely possible that is a problem specific to my machine. To help solve this problem for me, I added mount -o bind /home/git/repositories /repo
to /etc/rc.local
and restated my machine. Given that both the source and destination already exist as directories, the command works perfectly.
This means this:
ssh://git@my-git-server.com/home/git/repositories/project-name.git
is changed to this:
ssh://git@my-git-server.com/repo/project-name.git
Thankfully, the creators of Gitlab have created a very detailed install guide, and this guide will help you solve most problems you might encounter.
Conclusion
Gitlab might be a bit of a pain to setup, but it is totally worth it.
Thanks for reading
If you enjoyed what I wrote, consider upvoting this protip or endorsing me.
If you want to see more of my stuff, you can see other protips I have written or visit my profile.
Related protips:
Written by Nicholas Jordon
Related protips
12 Responses
BitBucket also allows for an unlimited number of private repos (and I suspect unlimited public repos, but they don't really say that). They support Git or Mercurial (just in case you are curious about that other one). They have an import function which works nicely with GitHub, which I've used to move all of my private repos from GH to BB. The free plan only allows for a max of 5 users.
@jacaetevha honestly I have never used bitbucket (mostly because I just never got around to trying it), but self-hosting does have some other advantages (which some people may like). Like being able to change what port your configuration runs on, running on an unlisted IP, or running it strictly over LAN (what my company is doing). Most things are security advantages, or simply just the amount of customization you can do, such as unlimited users or changing GUI of the system.
@projectcleverweb, true -- those are some advantages of self-hosting. I'll also mention that from a security standpoint, GH and BB both offer firewall installations (for a fee of course). As far as customizations, you are again correct, but the ability to customize can hurt you too (time, effort, etc.).
In short, not disagreeing at all, just offering more options. :)
Gitlab is a godsend. Nuff said.
Gitlab has really came a long way since I last looked at it (maybe 6-7 months ago). I have to say that I am in love with Bitbucket. Of course I use Github on a daily basis but Bitbucket's private repositories have been amazing for client projects where I work with maybe one or two other developers. Their UI has drastically improved over the last few months making it a wonderful competitor to Github.
If your willing to take the time to setup Gitlab it does have it's advantages and from what I can tell the developer[s] are really involved.
Nice tip Nicholas. Thanks.
Gitlab looks very nice indeed. Thanks for the protip, Nicholas!
I have one question, though. Since it's self hosted, do you think it brings any serious advantages over, say, Perforce, other than it being completely free and open source? (Perforce is closed and paid, but free for up to 20 users). I started using Perforce at Globant, and honestly fell in love with it and started using it for all my personal projects...
@lautarodragan I am not familiar with perforce, but self-host does bring some advantages that a 3rd party can't do. As mentioned before, you could setup Gitlab so that it only be accessed via LAN, which would allow an instant connection, and eliminate the possibility of remote hacking. You could also set it up as a server on your network, making it technically public, but the server would only be accessible to those you gave the IP of your network. Then there are aspects such as being able to change the listening port or having team management options. Other than that it is just a standard Git-based versioning system that is on par with most other versions systems.
I've been looking sreiously at GitLab, but so far I've not found a way for it to compete with Github's killer feature: their community.
GitLab works great for hosting my own code, and it's trivial to make it so that others can participate - but actually getting them to you Gitlab instance is kind of a pain.
Unfortunately, Github is closed source and possesses the advantage of the first mover. I don't think a distributed model is going to unseat them any time soon. I'd love to see them go more open, but until they do the situation isn't going to change unless a competitor exists that is both a codebase (a'la Gitlab) and a platform (a'la Github). Just being Open Source isn't good enough, and just having the social aspect isn't good enough.
One thing I couldn't figure out with Gitlab is how to use a private repo as a gem source in my Gemfile. In Github, one can generate a OAuth token and use it instead of a password, but I couldn't get it to work in Gitlab using the private token functionality. Any help would be appreciated.
Gitlab also now has a cloud solution (http://www.gitlab.com/cloud/)
Unlimited developers, Unlimited public/private repos, Cloud based (no installation necessary), Completely FREE!
@coderwall bafamydn is spam
Good article, thanks! :)