Git

From Blue-IT.org Wiki

Revision as of 20:39, 24 May 2015 by Apos (talk | contribs) (Gitosis)

HowTo

There are different ways to install git, gitolite, and webacces (e.g. [[#GitlabHQ|gitlabhq])] on Debian oder Ubuntu.

In any case: be sure to read the complete (!) gitolite documentation before you proceed. This article is mainly for Debian squeeze (6.0) server.

Mainly this boils down to:

  1. should use gitolite anyway
  2. which username you like to use by default to access the server: git, gitolite, whatever
  3. which port to use for ssh
  4. create a public or private repo
  5. have http access via smarthttp or gitlabhq
  6. install it manually or the "debian way" (apt-get), however the latter will give you automatic security updates

References

GitlabHQ

Fast, secure and stable solution based on Ruby on Rails & Gitolite.

Gitolite

Gitolite is the new framework around git. Easy project and user rights management.

Everything well documented online:

Troubleshooting

User git

After an uninstallation the user git remains on the system.

I had some problems (re)creating a user on my debian system (squeeze). I reverted (uninstalled) a gitolite installation and deleted the user git with

userdel -rf git

After that I had to recreate a new user git with:

useradd -d /home/git -b /home/git -m -s /bin/bash git
passwd git

If you not do this, there is not valid shell, the userdir in /home is not created and there is no password!

Gitosis

Is not activly maintained and developed any more. Use gitolite instead.

Troubleshooting

git pull
fatal: unable to access 'https://github.com/somewhere/': Failed to connect to github.com port 443: Connection timed out

Edit the local git configuration:

git config --global --edit

Possible solutions:

git config --global url."https://".insteadOf git://
git config --global --unset http.proxy
export GIT_SSL_NO_VERIFY=1
git config --global http.sslverify false

See:

* GIT://: http://stackoverflow.com/questions/21544803/git-bower-errors-exit-code-128-failed-connect
* PROXY: http://stackoverflow.com/questions/3512202/github-https-access
* SSL/CA: https://github.com/gitlabhq/gitlabhq/issues/4272