2020-05-02 07:56:04 +00:00
|
|
|
<!--
|
|
|
|
title: User git Repositories
|
|
|
|
description: Getting set up with git.tilde.institute
|
|
|
|
author: gbmor
|
|
|
|
-->
|
|
|
|
|
|
|
|
# User git Repositories
|
|
|
|
|
2020-07-12 16:42:38 +00:00
|
|
|
There's now an instance of [cgit](https://git.zx2c4.com/cgit) available
|
|
|
|
for all users to enjoy. Unlike the previous git repo hosting platform
|
|
|
|
I used, this does not require an additional signup. It's available
|
|
|
|
directly from your home directory. Tagged versions are automatically
|
|
|
|
bundled into `.tar.gz` archives and listed on the summary page.
|
2020-05-02 07:56:04 +00:00
|
|
|
|
2020-07-12 16:42:38 +00:00
|
|
|
All repos can be viewed at
|
|
|
|
[https://git.tilde.institute](https://git.tilde.institute)
|
2020-05-02 07:56:04 +00:00
|
|
|
|
2021-02-17 04:01:22 +00:00
|
|
|
**Note:** If a change doesn't appear in cgit immediately, wait a few
|
|
|
|
minutes. The cache will time out.
|
|
|
|
|
2020-05-02 07:56:04 +00:00
|
|
|
## Creating the directory
|
|
|
|
|
2020-07-12 16:42:38 +00:00
|
|
|
New users will not have to do this step. A `~/public_repos` link will
|
|
|
|
exist in your home directory. If you were a user before this was set up
|
|
|
|
(2020 May 1), you will need to create a symlink in your home directory
|
|
|
|
pointing into location in the httpd chroot where cgit will scan for
|
|
|
|
your repos.
|
2020-05-02 07:56:04 +00:00
|
|
|
|
2020-07-12 16:42:38 +00:00
|
|
|
There should be a directory corresponding to your username at the
|
|
|
|
following location:
|
2020-05-02 07:56:04 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
/var/www/cgit_repos/<USER>
|
|
|
|
```
|
|
|
|
|
|
|
|
Issue this command to create the symlink:
|
|
|
|
|
|
|
|
```
|
|
|
|
ln -s /var/www/cgit_repos/$USER ~/public_repos
|
|
|
|
```
|
|
|
|
|
|
|
|
## Adding a repository
|
|
|
|
|
2020-07-12 16:42:38 +00:00
|
|
|
Once `~/public_repos` exists, `cd` into it and create a directory
|
|
|
|
for your repo:
|
2020-05-02 07:56:04 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
mkdir foo.git
|
|
|
|
```
|
|
|
|
|
|
|
|
Change into *that* directory and initialize a bare repo:
|
|
|
|
|
|
|
|
```
|
|
|
|
cd foo.git; git init --bare
|
|
|
|
```
|
|
|
|
|
2021-02-17 04:01:22 +00:00
|
|
|
Now that the bare repo has been created, we'll need to set some configuration
|
|
|
|
options. You may use this command from within the directory you just created:
|
|
|
|
|
|
|
|
```
|
|
|
|
git config --local gitweb.owner "$USER <$USER@tilde.institute>"
|
|
|
|
```
|
|
|
|
|
|
|
|
Or, you may manually edit the file called `config` and append the following
|
|
|
|
section:
|
2020-05-02 07:56:04 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
[gitweb]
|
|
|
|
owner = user_name <user_name@tilde.institute>
|
|
|
|
```
|
|
|
|
|
2021-02-17 04:01:22 +00:00
|
|
|
Then, write out the text description of your repo into a file called
|
2020-07-12 16:42:38 +00:00
|
|
|
`description`:
|
2020-05-02 07:56:04 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
echo "My awesome repo!" > description
|
|
|
|
```
|
|
|
|
|
|
|
|
## Setting up the remote
|
|
|
|
|
2020-07-12 16:42:38 +00:00
|
|
|
If pushing from your home computer, add the following remote, replacing
|
|
|
|
`<USER>` with your username at tilde.institute, and `<REPO>` with
|
|
|
|
the repo directory:
|
2020-05-02 07:56:04 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
git remote add tilde.institute <USER>@tilde.institute:public_repos/<REPO>
|
|
|
|
```
|
|
|
|
|
2020-07-12 16:42:38 +00:00
|
|
|
If pushing from your home directory on tilde.institute, use this
|
|
|
|
format:
|
2020-05-27 22:06:41 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
git remote add tilde.institute /home/<USER>/public_repos/<REPO>
|
|
|
|
```
|
|
|
|
|
|
|
|
Now it's time to push to the repo you set up:
|
2020-05-02 07:56:04 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
git push -u tilde.institute master
|
|
|
|
```
|
|
|
|
|
|
|
|
## Checking the repo on [git.tilde.institute](git.tilde.institute)
|
|
|
|
|
2020-07-12 16:42:38 +00:00
|
|
|
Your repo should now be available at
|
|
|
|
`https://git.tilde.institute/<USER>/<REPO>`, without the `.git`
|
|
|
|
extension on the repo's directory.
|
2020-05-02 07:56:04 +00:00
|
|
|
|
2020-07-12 16:42:38 +00:00
|
|
|
If something's wrong, double-check everything, and then jump into
|
|
|
|
`#institute` on IRC.
|
2020-05-02 07:56:04 +00:00
|
|
|
|
|
|
|
## What about pull requests?
|
|
|
|
|
2020-07-12 16:42:38 +00:00
|
|
|
These don't exist. I suggest directing people to use [git
|
|
|
|
send-email](https://git-send-email.io) for patches.
|
2020-05-02 07:56:04 +00:00
|
|
|
|
|
|
|
## Namespacing projects
|
|
|
|
|
2020-07-12 16:42:38 +00:00
|
|
|
cgit will use the directory structure to namespace projects, if you
|
|
|
|
want to group related repositories.
|
2020-05-02 07:56:04 +00:00
|
|
|
|
2020-07-12 16:42:38 +00:00
|
|
|
For example, say you have a project called `widget`, which comprises
|
|
|
|
the two repos `libwidget` and `widget-cli`. One way to present
|
|
|
|
this here would be to use the following directory structure in
|
|
|
|
`~/public_repos`
|
2020-05-02 07:56:04 +00:00
|
|
|
|
|
|
|
```
|
|
|
|
~/public_repos/widget
|
|
|
|
~/public_repos/widget/libwidget.git
|
|
|
|
~/public_repos/widget/widget-cli.git
|
|
|
|
```
|
|
|
|
|
|
|
|
This will then show up in cgit as:
|
|
|
|
|
|
|
|
```
|
|
|
|
$USER
|
|
|
|
widget/libwidget
|
|
|
|
widget/widget-cli
|
|
|
|
```
|
|
|
|
|
2020-07-12 16:42:38 +00:00
|
|
|
When setting up the remote in your local copy of the repo, you would
|
|
|
|
use this for the `libwidget` example:
|
2020-05-02 07:56:04 +00:00
|
|
|
|
|
|
|
```
|
2020-07-12 16:42:38 +00:00
|
|
|
git remote add tilde.institute <USER>@tilde.institute:public_repos/widget/libwidget.git
|
2020-05-02 07:56:04 +00:00
|
|
|
```
|
|
|
|
|
|
|
|
## Misc
|
|
|
|
|
|
|
|
You can link to just your own repos via `https://git.tilde.institute/<USER>`
|
|
|
|
|
2020-07-12 16:42:38 +00:00
|
|
|
The following files will be parsed into an `about` page for a given
|
|
|
|
repo, in order:
|
2020-05-02 07:56:04 +00:00
|
|
|
|
2020-05-15 06:57:25 +00:00
|
|
|
* `README`
|
|
|
|
* `README.7`
|
|
|
|
* `README.1`
|
|
|
|
* `README.txt`
|
|
|
|
* `README.md`
|
2020-05-02 07:56:04 +00:00
|
|
|
|
|
|
|
[back](/)
|
|
|
|
|