How can I host Git repositories and manage my content-hosting myself?
Things such as Github, Bitbucket, DropBox -- manages the content-hosting such as tickets and repo -hosting (DB not tickets but can be used to store repos). I want a solution where I manage myself the content-hosting of thing such as Git -repositories and tickets.
Trial 0: trying to tune Git, too time-consuming
I followed the instructions here but some difficulties then I followed a lot of other tutorials with much more difficulties. I got cloning with "git clone --bare xxx xxx.git; cd xxx; git update-server-info" working but unable to push things with "--shared", got fed up to this kind of manual hacks. There is too much material, too much irrelevant material and too much outdated material.
I repeat I want to do the content-hosting myself. So how can I host my git repos?
If you're running a Linux server an option is to use Git + SSH.
On The Server
Create a user account called git which has permissions over your main git project directory. This is useful for allowing all collaborators to push on shared projects.
Add the RSA public key for each of your client machines to the authorized_keys file on the server. (You can generate a private-public key pair using ssh-keygen -t rsa -b 4096 on most Linux distributions.)
Create a new bare repository for your project as the git user. git init myproject --bare
On the Client
Turn on private key authentication by enabling the IdentifyFile in your ssh_config.
Clone the bare repository. git clone git@<server>:/var/git/myproject
Make your changes.
Commit the changes and push them back to the remote repo. git push origin master
If you need more specific instructions (such as the exact commands to create a user account) checkout the official Pro Git book.
I would go with Gitolite (manages the permissions) here and Redmine (manages the workflow over many repos) here. If you have no need for permission -management, please, go with Michael's solution. If you do not need to manage many repos, forget Redmine (useful with many repositories). The stuff here contain the same stuff as in Michael's answer but in third-party sites and some additions that you may need when your projects expand.
0. Git + SSH -keypair (Please, see the Michael's answer and below some outlining.)
If you are unable to do this, do not proceed forward -- this method shows the basic way of using bare -repos to content-host your repos. It takes some 2 minutes' time to do it, simply:
$ git init --bare test.git
$ eval `ssh-agent` $ ssh-add ~/your_auhorized_key_in_server $ git clone something@IP:test.git
1. Gitolite (managing perms of a team with different skills)
excellent step-by-step tutorial here (notice the "~/.ssh/authorized_keys" -file must have only gitolite -user)
check out repository -addition/removal here, yes it is that simple -- you just configure the config -file and then "$ git add .; git commit -m "new repos, old dead" and "$ git push"
"$ ssh email@example.com info" shows you the configuration
hello hhh, this is gitolite@ip-10-xxx-xx-203 running gitolite3 v3.03-29-g3c0f177 on git 22.214.171.124 R W helloworld R gitolite-admin R W testing
Cloning a repository under gitolite
$ git clone firstname.lastname@example.org:helloworld
2. Redmine/Trac/etc (managing workflow over repos in a central GUI place)
Instructions here for Redmine and be sure not to clone the unstable development branch in Github. You need to download some stable archieve. However, I would probably go with Trac, comparison here. Redmine was some Rails -hack and unstable master -branch does not sound good.
3. Ticgit/etc (managing tickets without thirdparty dependencies)