Skip to content

Commit 82c6f7b

Browse files
CypherpunkSamuraidelvha1012112796
authored
Added docs for agit-setup (#21027)
This PR Adds Documentation for the new Agit feature. Agit allows creating PR directly while pushing code. Close #21018 Co-authored-by: CypherpunkSamurai <[email protected]> Co-authored-by: delvh <[email protected]> Co-authored-by: a1012112796 <[email protected]>
1 parent 58a80ba commit 82c6f7b

File tree

1 file changed

+47
-0
lines changed

1 file changed

+47
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
---
2+
date: " 2022-09-01T20:50:42+0000"
3+
title: "Usage: Agit Setup"
4+
slug: "agit-setup"
5+
weight: 12
6+
toc: false
7+
draft: false
8+
menu:
9+
sidebar:
10+
parent: "usage"
11+
name: "Agit Setup"
12+
weight: 12
13+
identifier: "agit-setup"
14+
---
15+
16+
# Agit Setup
17+
18+
In Gitea `1.13`, support for [agit](https://git-repo.info/en/2020/03/agit-flow-and-git-repo/) was added.
19+
20+
## Creating PRs with Agit
21+
22+
Agit allows to create PRs while pushing code to the remote repo. \
23+
This can be done by pushing to the branch followed by a specific refspec (a location identifier known to git). \
24+
The following example illustrates this:
25+
26+
```shell
27+
git push origin HEAD:refs/for/master
28+
```
29+
30+
The command has the following structure:
31+
32+
- `HEAD`: The target branch
33+
- `refs/<for|draft|for-review>/<branch>`: The target PR type
34+
- `for`: Create a normal PR with `<branch>` as the target branch
35+
- `draft`/ `for-review`: Currently ignored silently
36+
- `<branch>/<session>`: The target branch to open the PR
37+
- `-o <topic|title|description>`: Options for the PR
38+
- `title`: The PR title
39+
- `topic`: The branch name the PR should be opened for
40+
- `description`: The PR description
41+
- `force-push`: confirm force update the target branch
42+
43+
Here's another advanced example for creating a new PR targeting `master` with `topic`, `title`, and `description`:
44+
45+
```shell
46+
git push origin HEAD:refs/for/master -o topic="Topic of my PR" -o title="Title of the PR" -o description="# The PR Description\nThis can be **any** markdown content.\n- [x] Ok"
47+
```

0 commit comments

Comments
 (0)