123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106 |
- Install the 'gitolite' package using your favorite package manager from the
- Debian repositories. It should require 'git' and 'openssh-server' and several
- other packages as dependencies (unless they are already installed). On the
- command-line this can be done by running the following command as root:
- # apt-get install gitolite
- When installing gitolite, debconf basically should prompt the user for several
- settings. However, due the a [bug] in the stable package, it doesn't happen
- automatically. If it did work for you when you installed the package - great.
- Otherwise, run the configuration program (as root) after the 'gitolite' package
- is installed:
- # dpkg-reconfigure gitolite
- The first setting you'll be asked to choose is the name of the user which
- gitolite will use to access the repositories. It can be any user, but it is
- safer to use a separate user. If the specified user doesn't exist, it will be
- automatically created.
- The default user is gitolite, but personally I prefer to decouple general git
- server details from the specific management software I use (gitolite is not the
- only one of its kind). Thus, since the gitolite user is the owner of the git
- repositories, I give it the name __git__. This is also seems to be the name used
- commonly for this purpose in other places.
- The second setting you need to fill in is the path where the repositories will
- be stored. This will also be the gitolite user's home directory. The default,
- /var/lib/gitolite, may be fine for many cases, but you should probably take the
- following into consideration:
- * __Disk encryption__: If you don't use a single disk partition for your whole
- file system, your home directory and the file system root (whose path is
- __/__) probably reside in different partitions. It is common to have the home
- partition encrypted while the root partition is not, so take that into account
- when choosing the path. This has an implication on anonymity: If you host your
- repositories on a darknet or in any other anonymous mechanism, storing them on
- an encrypted partition may prevent 3rd parties from figuring out who you are
- in case they file your lost harddrive. Otherwise it probably doesn't make a
- big difference, because your code is going to be available via your new git
- server anyway.
- * __Available space__: For the same reason explained above, it is common for
- home computers to have a large home partition and a smaller root partition
- (e.g. 300 GB home partition and 25 GB root partition). Files stored in version
- control are usually relatively small, i.e. they aren't binaries (executables,
- audio, video), but as repositories grow and new ones are added, this may
- become a consideration.
- * For the same reason I prefer __git__ as the name of the user, I prefer to not
- have 'gitolite' in the path of the repositories.
- Note that it is possible to use /var/lib/gitolite (or any other path) and simply
- make it a symbolic link which points to the real location of the repositories.
- Some common options are:
- + /var/lib/gitolite
- + /home/git
- + /opt/git
- + /srv/git
- For details on the purpose of the various folders, you can read about the
- [Filesystem Hierarchy Standard (FHS)][fhs].
- For the purpose of the example, let's use __/home/git__. The repositories
- themselves will be stored under a subfolder /home/git/repositories created for
- you automatically.
- The third and last thing you'll be asked is the SSH key of the administator.
- When gitolite is installed on a dedicated server, its configuration is usually
- done by connecting to it via SSH from a workstation, e.g. a personal computer of
- the developer. The SSH key specified should be the key of the person who will be
- in charge of managing the repositories and gitolite's configuration files. For
- example, it may be the lead developer or a system administrator or someone in
- the team who is hosting the server.
- In my case, the same computers multi-function as servers and as user desktops,
- so I use my personal SSH key. If the key needs to be sent over to the server
- from a remote location, e.g. a personal workstation, you can leave the setting
- empty and configure gitolite manually. [[TODO|TODO/OPEN]]
- A personal SSH key is commonly stored in your home folder, under the .ssh hidden
- folder. This folder usually contains the key as a pair of files:
- + /home/alice/.ssh/id_rsa
- + /home/alice/.ssh/id_rsa.pub
- The first file is your private key, which you should never give to anyone or
- send anywhere. The second file is the public key, and this is what you need to
- put on the server. If the server runs on your own computer, the key setting can
- be the path to the public key: __/home/alice/.ssh/id_rsa.pub__.
- After the last setting has been entered, the following message will be presented
- in the terminal:
- creating gitolite-admin...
- Initialized empty Git repository in /home/git/repositories/gitolite-admin.git/
- creating testing...
- Initialized empty Git repository in /home/git/repositories/testing.git/
- [master (root-commit) 5bd9b40] start
- 2 files changed, 6 insertions(+)
- create mode 100644 conf/gitolite.conf
- create mode 100644 keydir/admin.pub
- [bug]: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=699490
- [fhs]: https://en.wikipedia.org/wiki/Filesystem_Hierarchy_Standard
|