5 ms·
How to Create Your Own Git Server
- KevinEldon 13y agoGitblit [1] is a nice option if you want an easy install (standalone app or Java WAR) and it runs fine on Windows if that is a constraint you have. It's not as feature rich as some of the other choices out there, but it is actively developed and stable. [1] http://www.gitblit.com/ http://www.gitblit.com/
- danieldk 13y agoWe are moving to Gitblit too (from subversion). One of the things I like about Gitblit is that much of the configuration is backed by plain-text files. While that may not be ideal if you have thousands of repositories and a gazillion users, it makes it much easier to back up or change/fix something by hand. And indeed, the installation procedure is trivial :).
- 616c 13y agoInteresing that no one mentions cgit,[0] even though Linus and kernel developers moved away from the default (it comes with git itself) Gitweb Perl CGI Library a while ago.[1] Cgit is pretty impressive stuff as a frontend. I am sure it is a mess[2] (since people here constantly gawk and harp on people bold enough to do the following), but it is merely a giant C program handling CGI with built-in caching, and it is pretty damn efficient. It is crazy fast. I used to run it on a shared host, and boy was I impressed. Give it a look when you have a chance. You would be surprised how many large FOSS groups (if I recall correctly, I see the UI at OpenOffice, GNOME, KDE, and FreeDesktop umbrella groups). [0] http://git.zx2c4.com/cgit/ http://git.zx2c4.com/cgit/ [1] https://www.kernel.org/pelican.html https://www.kernel.org/pelican.html [2] http://www.linux.com/news/software/applications/667176-cgit-maintainer-disappears-security-hole-found http://www.linux.com/news/software/applications/667176-cgit-...
- johnchristopher 13y agoWhat a coincidence. I found out about cgit 30 minutes ago when looking for `pulseaudio-module-raop2`/ I was wondering about the CSS theming that gitweb instance so I looked at the source and cgit is now being compiled.
- PetrolMan 13y agoJust wanted to toss out another alternative in Stash by the folks at Atlassian. The setup was easy and it provides a nice interface that can hook in with Jira. Also, for small companies the 10 user license is free.
- Nux 13y agoDon't forget about GitBucket https://github.com/takezoe/gitbucket https://github.com/takezoe/gitbucket
- smoyer 13y agoOr you can just use Gitolite, Gitlab, etc
- irremediable 13y agoNice to see this summarised in one place. A lot of my projects are academic things that eventually end up on GitHub, but need to stay private for the first few months of their life. Hosting git on my VPS has been a godsend.
- actionscripted 13y agoIf you're doing all of that, why not take it a small step further and setup your own instance of GitLab? It's a bit more work, but it's by no means difficult if you follow the install directions. https://github.com/gitlabhq/gitlabhq/blob/master/doc/install/installation.md https://github.com/gitlabhq/gitlabhq/blob/master/doc/install...
- sytse 13y agoThanks for mentioning GitLab!
- neumann 13y agoor gitbucket, a single war file clone of github. I run gitlab for work, and gitbucket for personal and the latter is far easier to upgrade and maintain.
- neumann 13y agoor gitbucket, a single war file clone of github. I run gitlab for work, and gitbucket for personal and the latter is far easier to upgrade and maintain.
- neumann 13y agoor gitbucket, a single war file clone of github. I run gitlab for work, and gitbucket for personal and the latter is far easier to upgrade and maintain.
- zrail 13y agoI wrote an article last year that builds this same idea with Gitolite, with bonus automatic replication to S3. http://www.petekeen.net/hosting-private-git-repositories-with-gitolite http://www.petekeen.net/hosting-private-git-repositories-wit...
- mcormier 13y agoBeen doing this for quite some time. I found the following blog posts very useful when I was learning how to do this. http://scie.nti.st/2007/11/14/hosting-git-repositories-the-easy-and-secure-way http://scie.nti.st/2007/11/14/hosting-git-repositories-the-e...
- WestCoastJustin 13y agoRunning your own internal git server can have several advantages. Mainly, you are not sharing your code (IP) with external parties. There are many frontends you can strap onto a git server too, like Gitlab, Gitweb, Gerrit, and cgit [1, 2, 3, 4]. We use git/gitolite/gitweb heavily with our internal puppet infrastruture. You can have pre/post commit hooks for things like, syntax checking, email notification, and code deployments. Here is the workflow: +--------+ +---------+ | gitweb | |dashboard| staff +--------+ +---------+ nodes +-+ | | +-+ +-+-\ | | > +-+ \ +--+-----+ +------+-/ | |git | |puppet| +-+ -->| |gito-| +-> |master| -> +-+ +-+ | | lite| | | +-+ / +--+-----+ +------+- / | | \ +-+- | v > +-+ +-+ | email hook to +-+ | staff if production branch v syntax hook I created a screencast about running an internal git server with gitolite @ http://sysadmincasts.com/episodes/11-internal-git-server-with-gitolite http://sysadmincasts.com/episodes/11-internal-git-server-wit... [1] http://gitlab.org/ http://gitlab.org/ [2] https://git.wiki.kernel.org/index.php/Gitweb https://git.wiki.kernel.org/index.php/Gitweb [3] https://code.google.com/p/gerrit/ https://code.google.com/p/gerrit/ [4] http://git.zx2c4.com/cgit/ http://git.zx2c4.com/cgit/
- mbreese 13y agoJust to agree - having custom post-commit hooks can really be great for your deployment infrastructure. At an old job, I had post-commit hooks setup for deploying webapps, and once I got the developers on-board, it really made our devops cleaner. We had it all backed by gitolite. (I also got them to stop coding on the live sites, but that's another story).
- tomswartz07 13y agoWe use Gerrit/Gitweb here for our 2000+ node Puppet infrastructure. It's really nimble, and (when paired with Jenkins) is pretty much set-and-forget.
- deleted 13y ago[deleted]
- caniszczyk 13y agoYou can always use something like JGit: http://eclipse.org/jgit/ http://eclipse.org/jgit/ It's the underlying library that powers tools like Gerrit Code Review. Many ways to embed JGit too: http://alblue.bandlem.com/2013/11/embedding-jgit.html http://alblue.bandlem.com/2013/11/embedding-jgit.html
- sdesol 13y agoI'm not sure I would recommend this for 90% of the people out there and I build a product (http://gitsense.com http://gitsense.com) around it. Using Gitlab, gitolite, etc. would be much wiser choice in my opinion.
- caniszczyk 13y agoAgreed, should have prefixed it that if you wanted something more low level. Otherwise, Gitblit, Gitlab, Gerrit etc are better options.
- jtiseo 13y agoI actually just started using Gitprep and it is extremely lightweight and easy to set up. I threw it on a 128MB BuyVM account I had and it worked flawlessly. I tried Gitlab first, and while it had more features, it was far more resource intensive (since it was Rails). http://gitprep.org/ http://gitprep.org/
- Walkman 13y agoUse the "--shared" switch if users will commit the repository from the machine. For details see [1]. I think this makes step 5 unneccesary. If your ssh daemon listens on other port than 22, you can still use relative URL-s to your repo owner home directory like this [2]: ssh://user@host:port:/~/repository.git [1]: http://git-scm.com/book/en/Git-on-the-Server-Setting-Up-the-Server http://git-scm.com/book/en/Git-on-the-Server-Setting-Up-the-... [2]: http://stackoverflow.com/a/14349254/720077 http://stackoverflow.com/a/14349254/720077
- desireco42 13y agoWithout even reading this article I would say 'EASY!'. Git definitely makes it very easy to host and work with repositories. I like to use gitolite for administration, it works really well. Even before it, when git came to be, I was using ssh to host one on dreamhost, it is that easy.
- __david__ 13y agoIf you trust all your devs, there's also the even easier technique of just giving them accounts on the server and chgrp-ing a bare git repo so that they all have read/write access.
- aryastark 13y agoIf you just need something for yourself or a few people, you might consider an Android device. I use Gidder on a cheap tablet and it seems to work fine. Multiple users/repos. Easy to setup. It has a DynDNS option as well.
- pavanred 13y agoAm curious, I remember seeing a talk by Linus Torvalds on the internet where he explains git and how it incorporates a decentralized design to solve some inherent problems that the alternatives posed. Now, why is there emphasis on creating git servers?
- luckydude 13y agoMy guess is that while some people love the flexibility of a distributed system (lots of different and useful workflows) the average people like centralized. SVN has more market share than Git so far as I know. tl;dr: people like having less choices, it's less confusing.
- Gonzih 13y agoI use gitolite as my own git server, pretty happy with it. Easy to configure and maintain.
- ericedge 13y agoI'm unclear on why this recommends setting up a user account for every committer. I'm a big fan of simply adding each committer's ssh key to a single "git" user account to avoid the overhead of managing multiple user accounts--you have to make sure each ssh key line is identified by the user submitting it in case it needs removal in the future, but it's much easier to manage adding and removing users. There are some additional configuration steps for that single user, but most are covered in the manual at http://git-scm.com/book/en/Git-on-the-Server-Setting-Up-the-Server http://git-scm.com/book/en/Git-on-the-Server-Setting-Up-the-... Is there some advantage to separate user accounts that I'm missing?
- droptableusers 13y agoI use GitLab on my VPS (KVM Advanced @ Edis) and I am very happy with it. However, it uses unreasonable amount of resources. I am pretty much all out of resources after deploying GitLab. I will probably switch to something else even if it has less features and worse interface as long as it use less resources.