- Improve introductory paragraph - Explain Agit's use cases briefly - Add required parameter markers - Explain caveats - Minor grammar improvements
2.1 KiB
title | license | origin_url |
---|---|---|
Agit Setup | Apache-2.0 | abe8fe3527/docs/content/usage/agit-support.en-us.md |
Forgejo ships with limited support for Agit.
Agit allows creating pull requests to a target repository by pushing directly to the target, without having to create forks or accessing the web UI.
Creating Pull Requests
Creating a new Pull Request can be done by pushing to the branch of your choice followed by a specific refspec (a location identifier known to Git).
Here is an example:
git push origin HEAD:refs/for/master
The command has the following structure:
HEAD
: The target branch (required)refs/<for|draft|for-review>/<branch>
: The target PR type (required)for
: Create a normal PR with<branch>
as the target branchdraft
/for-review
: Currently ignored silently
<branch>/<session>
: The target branch to open the PR (required)-o <topic|title|description>
: Options for the PRtitle
: The PR titletopic
: The branch name the PR should be opened for (required)description
: The PR descriptionforce-push
: confirm force update the target branch
Caveats
Pushing new changes to an existing Pull Request created with Agit requires some caution. Otherwise, Forgejo may not be able to associate your new changes with your existing Pull Request, resulting in the creation of a new Pull Request.
If you wish to push additional changes to a pull request that you previously created using Agit, you must use the same topic that you used before.
If you rebase your local commits, you must use the topic you previously used together with the force-push
option.
Examples
In this example, we will create a new PR targeting master
using the parameters topic
, title
, and description
:
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"