惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hugging Face - Blog
Hugging Face - Blog
Jina AI
Jina AI
宝玉的分享
宝玉的分享
奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
人人都是产品经理
人人都是产品经理
博客园 - 聂微东
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
J
Java Code Geeks
博客园 - 【当耐特】
小众软件
小众软件
博客园 - Franky
S
SegmentFault 最新的问题
WordPress大学
WordPress大学
雷峰网
雷峰网
The Cloudflare Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
量子位
Last Week in AI
Last Week in AI
博客园_首页
月光博客
月光博客
IT之家
IT之家
阮一峰的网络日志
阮一峰的网络日志
Webroot Blog
Webroot Blog
Stack Overflow Blog
Stack Overflow Blog
腾讯CDC
云风的 BLOG
云风的 BLOG
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
W
WeLiveSecurity
Recent Commits to openclaw:main
Recent Commits to openclaw:main
D
Docker
The Last Watchdog
The Last Watchdog
有赞技术团队
有赞技术团队
Hacker News - Newest:
Hacker News - Newest: "LLM"
D
DataBreaches.Net
S
Security @ Cisco Blogs
Blog — PlanetScale
Blog — PlanetScale
GbyAI
GbyAI
TaoSecurity Blog
TaoSecurity Blog
S
Security Affairs
Y
Y Combinator Blog
O
OpenAI News
罗磊的独立博客
MongoDB | Blog
MongoDB | Blog
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Forbes - Security
Forbes - Security
P
Palo Alto Networks Blog
freeCodeCamp Programming Tutorials: Python, JavaScript, Git & More
K
Kaspersky official blog
Cloudbric
Cloudbric

Emil Burzo

GPS spoofing teleported me to Peru, mid-flight Running Claude Code dangerously (safely) Reverse engineering the Nest home/away API Tracking down an old OkHttp regression What does StackOverflow's personalized prediction data think of you? Cum se plătesc impozitele PFA prin BT24 Work-around for when keyserver.ubuntu.com is down Creating a tailable cursor on MongoDB 3 with the Java driver API Quick fix for CVE-2015-1328 Analiza parcului auto din România
Setting up gitolite on Ubuntu 12.04 LTS
2014-02-19 · via Emil Burzo

Introduction

In this post we will be looking at how to self-host git using gitolite.

First off, you will have to decide if you are ok with using the (slightly older) version in the Ubuntu package repository.

Right now, gitolite is at version 3, while the version in the LTS repository is 2.

Moving on, in this guide we will be using the repository version.

Setup

Use apt-get to install gitolite

sudo apt-get install gitolite

After that’s done, we proceed with configuring gitolite:

sudo dpkg-reconfigure gitolite

You will be presented with some pretty dialog… dialogs with the following questions:

System username for gitolite

You can leave the default gitolite username, but if you want to type less when cloning git repositories, you can set it to git (don’t forget to check if the username not already taken by something else on the system)

Repository path

If you are unsure, you can leave the default.

Personally, I prefer /home/gitolite

Administrator’s SSH key

You can either upload your public key file (you do have one, right? if not, see here) somewhere on the server and input the path to the file, or paste it directly.

The administrative repository

Gitolite operates under the principle that you have an administrative repository, and you configure everything from there.

Therefore, we clone the administrative repository:

git clone GITOLITE_USERNAME@SERVER_ADDRESS:gitolite-admin.git

For example:

git clone git@192.168.0.146:gitolite-admin.git

This URI scheme assumes you are using the standard SSH port (22).

If that is not the case, you will have to use the following, lengthier syntax:

git clone ssh://GITOLITE_USERNAME@SERVER_ADDRESS:SERVER_PORT/gitolite-admin.git

Example:

git clone ssh://git@192.168.0.146:12345/gitolite-admin.git

By default, the gitolite administrative repository looks like this:

gitolite-admin/
|-- conf                      <-- configuration dir
|   `-- gitolite.conf         <-- configuration file
`-- keydir                    <-- key store directory
    `-- admin.pub             <-- key file, must end in .pub

Creating a new repository

We edit the gitolite-admin/conf/gitolite.conf file and add the following:

repo    REPOSITORY_NAME
        RW+     =   USER_KEY_NAME

For example:

repo    testing
        RW+     =   admin

The permission types are:

  • R means “read” permission
  • RW means “read and write”, but no rewind
  • RW+ means “read and write”, with rewind allowed

Save the config file then commit the changes:

git add .
git commit -m "created testing repository"
git push

Git documentation is outside the scope of the tutorial.

Congratulations! You now have a new repository which you can clone like so:

git clone git@192.168.0.146:testing.git

And that’s it!

But what if we want to give someone else access to our repository?

Adding a new user

First, you need to add his or hers ssh public key to the keydir folder in a file with the following name: user.pub

After that, we edit the gitolite.conf file and add the user to the appropriate directory.

From the gitolite-admin folder, we save and push everything:

git add -A .
git commit -m "added user XXX"
git push

And that should be it.

Tips

  • A user can have multiple key files, just add more files and keep this naming pattern: user@host.pub, user@another-host.pub, user@whatever.pub. And in the config file you can just reference ‘user’ and it will work with any of the previous three keys.
  • Use an openssh ssh_config file to simplify git URIs or ssh connections