summaryrefslogtreecommitdiff
path: root/creating-a-repo-from-scratch.md
blob: 1e0b36995c53fb135cdfc49e17bc0cca87596eb3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
# Creating a new repo from scratch

This works for anyone in the `@creators` gitolite group (currently
`bryan` and `red`). You don't need to ask an admin to declare the repo
first — pushing to a name under your own `personal/<you>/...` namespace
creates it automatically.

## 1. Pick a name

```
personal/<your-username>/<reponame>
```

e.g. `personal/bryan/my-project`. You can only create repos under your
own username segment — gitolite checks the pushing user's identity
against that path component, so `red` can create `personal/red/...` but
gets denied on `personal/bryan/...`.

## 2. Clone the (not-yet-existing) repo

```bash
git clone git@git.veltar.systems:personal/bryan/my-project
```

Git will warn "you appear to have cloned an empty repository" — that's
expected, it doesn't exist on the server yet.

## 3. Add something and push

```bash
cd my-project
echo "# my-project" > README.md
git add README.md
git commit -m "Initial commit"
git push -u origin master   # or main, whichever branch you're on
```

That push is what actually creates the bare repo on gwaihir. From here
on it's a completely normal git remote.

## 4. (Optional) give someone else access

You own this repo (`RW+`) and can grant others access yourself, without
an admin editing any config:

```bash
ssh git@git.veltar.systems perms personal/bryan/my-project + RW someone
```

Use `RW+` instead of `RW` if they should also be able to force-push /
rewrite history. To revoke, replace `+` with `-`:

```bash
ssh git@git.veltar.systems perms personal/bryan/my-project - RW someone
```

## What this doesn't do

Creating the repo does **not** make it visible on the web UI
(`git.veltar.systems`) — it's SSH-only until an admin explicitly adds it
to cgit's config. See [making-a-repo-public.md](making-a-repo-public.md).