Skip to content

Commit db9bb36

Browse files
Push to create docs (#23458)
This PR adds user friendly documentation on how to use push to create feature
1 parent 8e40634 commit db9bb36

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
---
2+
date: "2020-07-06T16:00:00+02:00"
3+
title: "Usage: Push To Create"
4+
slug: "push-to-create"
5+
weight: 15
6+
toc: false
7+
draft: false
8+
menu:
9+
sidebar:
10+
parent: "usage"
11+
name: "Push To Create"
12+
weight: 15
13+
identifier: "push-to-create"
14+
---
15+
16+
# Push To Create
17+
18+
Push to create is a feature that allows you to push to a repository that does not exist yet in Gitea. This is useful for automation and for allowing users to create repositories without having to go through the web interface. This feature is disabled by default.
19+
20+
## Enabling Push To Create
21+
In the `app.ini` file, set `ENABLE_PUSH_CREATE_USER` to `true` and `ENABLE_PUSH_CREATE_ORG` to `true` if you want to allow users to create repositories in their own user account and in organizations they are a member of respectively. Restart Gitea for the changes to take effect. You can read more about these two options in the [Configuration Cheat Sheet]({{< relref "doc/advanced/config-cheat-sheet.en-us.md#repository-repository" >}}).
22+
23+
## Using Push To Create
24+
25+
Assuming you have a git repository in the current directory, you can push to a repository that does not exist yet in Gitea by running the following command:
26+
27+
```shell
28+
# Add the remote you want to push to
29+
git remote add origin git@{domain}:{username}/{repo name that does not exist yet}.git
30+
31+
# push to the remote
32+
git push -u origin main
33+
```
34+
35+
This assumes you are using an SSH remote, but you can also use HTTPS remotes as well.

0 commit comments

Comments
 (0)