Scroll to navigation

GCLI-PULLS(1) General Commands Manual GCLI-PULLS(1)

NAME

gcli pullsManage Pull Requests on Git Forges

SYNOPSIS

gcli pulls [-a] [-A author] [-L label] [-M milestone] [-s] [-n n] [-o owner -r repo] [search-terms...]

gcli pulls -i pr [-o owner -r repo] actions...

gcli pulls create [-o owner -r repo] [-t branch] [-f owner:branch] [-y] [PR title...]

DESCRIPTION

Use gcli pulls to list, create, edit or delete Pull Requests (PRs) in repositories on various git(1) forges such as GitLab, Gitea or GitHub. Without any action specified, gcli pulls will list open PRs in the given or autodetected repository.

OPTIONS

, --sorted
Reverse the output such that most recent items appear at the bottom.
, --owner owner
List PRs in the repository of the given owner. This option can only be used in combination with -r.
, --repo repo
List PRs in the given repository. This option can only be used in combination with -o.
, --author author
Filter pull requests by the given author.

Note that the implementation is somewhat limited on GitHub and Gitea since the respective API does not allow off-loading the filtering to its side. Due to this fact using this option may take an increased amount of time because gcli pulls needs to iterate all the fetched data and filter out the requested information.

, --label label
Filter pull requests by the given label. See the notes about the -A option above - the same reasoning applies to this option.
, --milestone milestone
Filter pull requests by the given milestone. See the notes about the -A option above - the same reasoning applies to this option.
List all PRs, including closed and merged ones. Cannot be combined with actions. This does not affect the -n option. Note that this flag has a different meaning in the create subcommand. See SUBCOMMANDS for more information.
, --count n
Fetch at least n pull requests. Default: 30. If n is set to -1 this will fetch all pull requests. Note that on large repositories fetching all pull requests can take a considerable amount of time and may result in rate limiting by the respective API.
, --id PR
execute the given actions on the specified PR.

SUBCOMMANDS

Create a new PR in the given or autodetected repository. The editor will come up and ask you to enter the PR message.

When the title is omitted gcli will interactively prompt the various options listed below, including the title.

The following flags can be specified:

, --owner owner
Specify the owner of the repository where the PR is to be created.
, --repo repository
Specify the name of the repository where the PR is to be created.
, --to branch
The target (base) branch of the PR. This is the branch the commits are to be merged into. You may omit this flag if you have set pr.base in your .gcli config file.
, --from owner:branch
The source (head) branch of the PR. This is the branch that contains the commits that are to be merged into the target repository. You may omit this flag and gcli will try to infer this information.
, --yes
Do not ask for confirmation before creating the PR. Assume yes.
, --automerge
Enable the automerge feature when creating the PR.
PR Title...
The title of the Pull Request or Merge Request.

ACTIONS

actions... may be one or more of the following:

Get all the relevant information about a PR. The following actions are implied: status, op, commits and ci.
Print the list of commits associated with the Pull Requests.
Print a list of comments under the PR.
Print metadata of the commit such as the ID, head and base branch etc.
Print the original post of the Pull Request.
Print a list of checks that ran on the PR (GitLab Pipelines and GitHub CI).
Print a diff of the changes attached to the PR. This can be piped into patch(1) or git-apply(1).
Close the PR.
Reopen a closed PR.
[options]
Merge the PR. The source branch is deleted by default unless you set the “pr.inhibit-delete-source-branch” option to yes in your .gcli file. You may supply the following options:
, -s
Squash the commits before merging.
, -D
Delete the source branch after merging.
milestone-id
Assign the pull request to the given milestone-id.
-d
Clear a set milestone on the pull request.
Alias for the comments action that prints a list of comments associated with the PR.
[options]
The following options can be specified more than once:
add label
Add the given label to the pull request.
remove label
Remove the given label from the pull request.
new-title
Change the title of the pull request to new-title.

EXAMPLES

Print a list of open PRs in the current project:

$ gcli pulls

Create a new PR and let gcli interactively prompt you for details:

$ gcli pr create

Create a new PR in the current Project, the head is the currently checked out branch of git. See git-status(1) The base will be what pr.base in .gcli is set to.

$ gcli pulls create "summary here"

Print both a summary and comments of PR 11 in herrhotzenplotz/gcli:

$ gcli pulls -o herrhotzenplotz -r gcli -i 11 all comments

Merge PR 42 in the upstream repository:

$ gcli pulls -i 42 merge

Note that you could also pull the PR head and merge it manually into the base branch. Assuming trunk is the base branch:

$ git fetch upstream pull/42/head:42-review
$ git checkout 42-review
$ <make etc>
$ git checkout trunk
$ git merge --no-ff 42-review

List pull requests that have the “bug” label:

$ gcli pulls -L bug

List pull requests that are associated with the milestone “version420”:

$ gcli pulls -M version420

Change the title of pull request #42 on Github to “This is the new title”:

$ gcli -t github pulls -i 42 title "This is the new title"

Same command as above, but with abbreviated pulls subcommand:

$ gcli -t github pu -i 42 title "This is the new title"

SEE ALSO

git(1), git-merge(1), git-branch(1), gcli(1), patch(1)

AUTHORS

Nico Sonack aka. herrhotzenplotz <nsonack@herrhotzenplotz.de> and contributors.

BUGS

Please report bugs via E-Mail to ~herrhotzenplotz/gcli-discuss@lists.sr.ht.

Alternatively you can report them on any of the forges linked at https://herrhotzenplotz.de/gcli. However, the preferred and quickest method is to use the mailing list.

2024-May-25 gcli 2.3.0