GCLI-PULLS(1)

NAME
gcli pulls - Manage Pull Requests on Git Forges

SYNOPSIS
gcli [-a] [-A author] [-L label] [-M milestone] [-s] [-n n] [-o owner -r repo]
gcli -i pr [-o owner -r repo] actions...
gcli create [-o owner -r repo] [-t branch] [-f owner:branch] [-y] PR title...

DESCRIPTION
Use gcli 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 will list open PRs in the given or autodetected repository.

OPTIONS

-s, --sorted
    Reverse the output such that most recent items appear at the bottom.

-o, --owner owner
    List PRs in the repository of the given owner. This option can only be used in combination with -r.

-r, --repo repo
    List PRs in the given repository. This option can only be used in combination with -o.

-A, --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 needs to iterate all the fetched data and filter out the requested information.

-L, --label label
    Filter pull requests by the given label. See the notes about the -A option above - the same reasoning applies to this option.

-M, --milestone milestone
    Filter pull requests by the given milestone. See the notes about the -A option above - the same reasoning applies to this option.

-a  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.

-n, --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.

-i, --id PR
    execute the given actions on the specified PR.

SUBCOMMANDS

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

    The following flags can be specified:

    -o, --owner owner
        Specify the owner of the repository where the PR is to be created.

    -r, --repo repository
        Specify the name of the repository where the PR is to be created.

    -t, --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.

    -f, --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.

    -y, --yes
        Do not ask for confirmation before creating the PR. Assume yes.

    -a, --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:

all Get all the relevant information about a PR. The following actions are implied: status, op, commits and ci.

commits
    Print the list of commits associated with the Pull Requests.

comments
    Print a list of comments under the PR.

status
    Print metadata of the commit such as the ID, head and base branch etc.

op  Print the original post of the Pull Request.

ci  Print a list of checks that ran on the PR (GitLab Pipelines and GitHub CI).

diff
    Print a diff of the changes attached to the PR. This can be piped into patch(1) or git-apply(1).

close
    Close the PR.

reopen
    Reopen a closed PR.

merge [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:

    --squash, -s
        Squash the commits before merging.

    --inhibit-delete, -D
        Delete the source branch after merging.

milestone milestone-id
    Assign the pull request to the given milestone-id.

milestone -d
    Clear a set milestone on the pull request.

notes
    Alias for the comments action that prints a list of comments associated with the PR.

labels [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.

title 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 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.