You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: docs/content/doc/usage/push.en-us.md
+38-7
Original file line number
Diff line number
Diff line change
@@ -1,18 +1,51 @@
1
1
---
2
2
date: "2020-07-06T16:00:00+02:00"
3
-
title: "Push To Create"
4
-
slug: "push-to-create"
3
+
title: "Usage: Push"
4
+
slug: "push"
5
5
weight: 15
6
6
toc: false
7
7
draft: false
8
8
menu:
9
9
sidebar:
10
10
parent: "usage"
11
-
name: "Push To Create"
11
+
name: "Push"
12
12
weight: 15
13
-
identifier: "push-to-create"
13
+
identifier: "push"
14
14
---
15
15
16
+
**Table of Contents**
17
+
18
+
{{< toc >}}
19
+
20
+
There are some additional features when pushing commits to Gitea server.
21
+
22
+
# Open PR through Push
23
+
24
+
When you push commits to a non-default branch for the first time,
25
+
you will receive a link you can click on to visit the compare page of your branch compared to your main branch.
26
+
From there, it's easy to create a pull request, even if you want to target another branch.
27
+
28
+

29
+
30
+
# Push Options
31
+
32
+
In Gitea `1.13`, support for some [push options](https://git-scm.com/docs/git-push#Documentation/git-push.txt--oltoptiongt)
33
+
were added.
34
+
35
+
## Supported Options
36
+
37
+
-`repo.private` (true|false) - Change the repository's visibility.
38
+
39
+
This is particularly useful when combined with push-to-create.
40
+
41
+
-`repo.template` (true|false) - Change whether the repository is a template.
42
+
43
+
Example of changing a repository's visibility to public:
44
+
45
+
```shell
46
+
git push -o repo.private=false -u origin main
47
+
```
48
+
16
49
# Push To Create
17
50
18
51
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.
@@ -35,6 +68,4 @@ git push -u origin main
35
68
36
69
This assumes you are using an SSH remote, but you can also use HTTPS remotes as well.
37
70
38
-
## Push options (bonus)
39
-
40
-
Push-to-create will default to the visibility defined by `DEFAULT_PUSH_CREATE_PRIVATE` in `app.ini`. To explicitly set the visibility, you can use a [push option]({{< relref "doc/usage/push-options.en-us.md" >}}).
71
+
Push-to-create will default to the visibility defined by `DEFAULT_PUSH_CREATE_PRIVATE` in `app.ini`.
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.
52
+
53
+
## Enabling Push To Create
54
+
55
+
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/administration/config-cheat-sheet.zh-tw.md#repository-repository" >}}).
56
+
57
+
## Using Push To Create
58
+
59
+
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:
60
+
61
+
```shell
62
+
# Add the remote you want to push to
63
+
git remote add origin git@{domain}:{username}/{repo name that does not exist yet}.git
64
+
65
+
# push to the remote
66
+
git push -u origin main
67
+
```
68
+
69
+
This assumes you are using an SSH remote, but you can also use HTTPS remotes as well.
// GetIssuePostersWithSearch returns users with limit of 30 whose username started with prefix that have authored an issue/pull request for the given repository
159
+
// If isShowFullName is set to true, also include full name prefix search
0 commit comments