- Gitolite Essentials
- Sitaram Chamarty
- 480字
- 2021-07-16 12:10:04
Sampling of Gitolite's power features
The access control examples show the most commonly used feature of Gitolite, the repository and branch level access control, but of course Gitolite has many more features. In this section, we will briefly look at a few of them while noting that there are many more waiting in the wings for you to find as you read this book.
Creating groups
Gitolite allows you to create groups of users or repositories for convenience. Think back to Alice and Bob, our junior developers. Let's say you had several rules that Alice and Bob needed to be mentioned in. Clearly, this is too cumbersome; every time a new developer joined the team, you'd have to change all the rules to add him or her.
Gitolite lets you do this by using the following command:
@junior-devs = alice bob
Later, it lets you do this by using the following command:
repo foo RW = @junior-devs RW+ = carol david RW+ sandbox/ = @junior-devs
This allows you to add the junior developer in just one place at the top of the configuration file instead of potentially several places all over. More importantly, from the administrator's point of view, it serves as excellent documentation for the rules themselves; isn't it easier to reason about the rules when a descriptive group name is used rather than actual usernames?
Personal branches
Gitolite allows the administrator to give each developer a unique set of branches, called personal branches, that only he or she can create, push, or delete. This is a very convenient way to allow quick backups of work-in-progress branches, or share code for preliminary review.
We saw how the sandbox area was defined:
RW+ sandbox/ = alice bob
However, this does nothing to prevent one junior developer from accidentally wiping out another's branches. For example, Alice could delete a branch called sandbox/bob/work
that Bob may have pushed. You can use the special word USER
as a directory name to solve this problem:
RW+ sandbox/USER/ = alice bob
This works as if you had specified each user individually, like this:
RW+ sandbox/alice/ = alice RW+ sandbox/bob/ = bob
Now, the set of branches that Alice is allowed to push is limited to those starting with sandbox/alice/
, and she can no longer push or delete a branch called, say, sandbox/bob/work
.
Personal repositories
With Gitolite, the administrator can choose to let the user create their own repositories, in addition to the ones that the administrator themselves creates. For this example, ignore the syntax, which will be explained in a much later chapter, but just focus on the functionality now:
repo dev/CREATOR/[a-z].* C = @staff RW+ = CREATOR
This allows members of the @staff
group to create repositories whose names match the pattern supplied, which just means dev/<username>/<anything starting with a lowercase alphabetic character>
. For example, a user called alice
will be able to create repositories such as dev/alice/foo
and dev/alice/bar
.
- Java實(shí)用組件集
- 一本書(shū)玩轉(zhuǎn)數(shù)據(jù)分析(雙色圖解版)
- 返璞歸真:UNIX技術(shù)內(nèi)幕
- 機(jī)艙監(jiān)測(cè)與主機(jī)遙控
- 城市道路交通主動(dòng)控制技術(shù)
- 新手學(xué)電腦快速入門(mén)
- 悟透AutoCAD 2009完全自學(xué)手冊(cè)
- 過(guò)程控制系統(tǒng)
- ASP.NET 2.0 Web開(kāi)發(fā)入門(mén)指南
- 和機(jī)器人一起進(jìn)化
- 電腦上網(wǎng)入門(mén)
- 三菱FX/Q系列PLC工程實(shí)例詳解
- 3ds Max造型表現(xiàn)藝術(shù)
- 人工智能:智能人機(jī)交互
- Learning OpenShift