aboutsummaryrefslogtreecommitdiff
path: root/infrastructure/roles/git/README.md
blob: 37f6cebe266fedf564b07d36cc51f7954da39f8c (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
# git

## Create a repository

On the server:

```
git init --bare $REPOSITORY_PATH
```

## Push an existing repository

```
git remote add $REMOTE $SERVER_HOSTNAME:$REPOSITORY_PATH
git push $REMOTE main
```

## Exposing via gitweb

```
sudo ln -s $REPOSITORY_PATH /var/lib/git/$NAME.git
```

## Exposing via https

```
mv $REPOSITORY_PATH/hooks/post-update.sample $REPOSITORY_PATH/hooks/post-update
ln -s $REPOSITORY_PATH ~/public_html/$REPO.git
```

Ensure that you push once to the repo, or run `git update-server-info` in the repository.

## Using non-bare repositories

Alternatively, use non-bare repositories and symlink the `.git` directory to `/var/lib/git` or `~/public_html`.