cqbiiq
Last Updated: March 09, 2017
·
23.7K
· projectcleverweb
Big pimpin

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.

11 Responses
Add your response

6848
D21ebccf20562e370eb0a8cf170a0580

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.

over 1 year ago ·
6850
Big pimpin

@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.

over 1 year ago ·
6851
D21ebccf20562e370eb0a8cf170a0580

@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. :)

over 1 year ago ·
6919
3c63c8f8e8637c7bac2900a3c04500a9

Gitlab is a godsend. Nuff said.

over 1 year ago ·
6924
C84cc3417eb01380e6aa5c31b2d39cfd

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.

over 1 year ago ·
6943

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...

over 1 year ago ·
6950
Big pimpin

@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.

over 1 year ago ·
6992
42595607ede5ee9c75f4da244128a082

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.

over 1 year ago ·
8622
C872cb3bdd544b85367ae9faa869c6ad

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.

over 1 year ago ·
9821
0 sldsnyhmw56huwjtshmlnpwmwtlkuwztfbjlnprpnk5nkd7 3ijn4y7 bfau4mmyu6ikmuwyyjh6

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!

over 1 year ago ·
15524
Big pimpin

@coderwall bafamydn is spam

over 1 year ago ·