Scroll to navigation

GIT-OBS(1) Generated Python Manual GIT-OBS(1)

NAME

git-obs - Git based command-line client for Open Build Service

SYNOPSIS

git-obs [global opts] <command> [--help] [opts] [args]

DESCRIPTION

git-obs is a command-line client for interacting with Git repositories within a Gitea instance that is part of an Open Build Service (OBS).

OPTIONS

Mute unnecessary output

Path to gitea config. Default: $GIT_OBS_CONFIG or ~/.config/tea/config.yml.

Name of the login entry in the config file. Default: $GIT_OBS_LOGIN or the default entry from the config file. Alternatively, you can use gitea url as long as there's only a single matching entry in the config file.

You can omit this argument and set GIT_OBS_GITEA_URL, GIT_OBS_GITEA_USER, and GIT_OBS_GITEA_TOKEN environmental variables instead. Optional variables: GIT_OBS_GITEA_SSH_KEY

To override the existing values from the config file, you can specify the following environmental variables:
- GIT_OBS_LOGIN_<LOGIN-NAME>_USER
- GIT_OBS_LOGIN_<LOGIN-NAME>_TOKEN
- GIT_OBS_LOGIN_<LOGIN-NAME>_SSH_KEY Setting new ``name`` or ``url`` is not possible. Please note that the login name that is part of the environmental variable name is case sensitive.

COMMANDS

git-obs api

Make an arbitrary request to API

usage: git-obs [global opts] api [-h] [-X {GET,HEAD,POST,PATCH,PUT}]
[--data DATA]
url

arguments:

options:

git-obs login

Manage configured credentials to Gitea servers

git-obs [global opts] login

usage: git-obs [global opts] login [-h]
{add,gitcredentials-helper,list,remove,update} ...

git-obs login add

Add a Gitea credentials entry

usage: git-obs [global opts] add [-h] --url URL --user USER [--token TOKEN]
[--ssh-key PATH] [--git-uses-http] [--quiet]
[--set-as-default]
name

arguments:

The name of the login entry to be added

options:

Gitea URL, for example https://example.com

Gitea username

Gitea access token; omit or set to '-' to invoke a secure interactive prompt

Path to a private SSH key

Git uses http(s) instead of SSH

Mute unnecessary output when using this login entry

Set the new login entry as default

git-obs login list

List Gitea credentials entries

usage: git-obs [global opts] list [-h] [--show-tokens]

options:

Show tokens in the output

git-obs login remove

Remove a Gitea credentials entry

usage: git-obs [global opts] remove [-h] name

arguments:

The name of the login entry to be removed

git-obs login update

Update a Gitea credentials entry

usage: git-obs [global opts] update [-h] [--new-name NEW_NAME] [--new-url URL]
[--new-user USER] [--new-token TOKEN]
[--new-ssh-key PATH]
[--new-git-uses-http {0,1,yes,no}]
[--new-quiet {0,1,yes,no}]
[--set-as-default]
name

arguments:

The name of the login entry to be updated

options:

New name of the login entry

New Gitea URL, for example https://example.com

Gitea username

Gitea access token; set to '-' to invoke a secure interactive prompt

Path to a private SSH key

Git uses http(s) instead of SSH

Mute unnecessary output when using this login entry

Set the login entry as default

git-obs meta

Manage metadata in .git/obs store

git-obs [global opts] meta

usage: git-obs [global opts] meta [-h] {info,list,pull,reset,set} ...

git-obs meta info

Resolve and print metadata about the current checkout

usage: git-obs [global opts] info [-h] [--type | --apiurl | --project |
--package | --branch | --commit | --remote |
--remote-url | --export]

options:

Print type

Print apiurl

Print project

Print package

Print branch

Print commit

Print remote

Print remote_url

Show json objects instead of human readable text

git-obs meta list

List metadata in store

usage: git-obs [global opts] list [-h] [--branch BRANCH]

options:

Manage values for the specified branch (default: current branch)

git-obs meta pull

Pull metadata about the project or package from Gitea.

usage: git-obs [global opts] pull [-h]

git-obs meta reset

Reset metadata in store

usage: git-obs [global opts] reset [-h] [--branch BRANCH]

options:

Manage values for the specified branch (default: current branch)

git-obs meta set

Set metadata in store

usage: git-obs [global opts] set [-h] [--apiurl APIURL] [--project PROJECT]
[--package PACKAGE] [--branch BRANCH]

options:

Set 'apiurl'

Set 'project'

Set 'package'

Manage values for the specified branch (default: current branch)

git-obs pr

Manage pull requests

git-obs [global opts] pr

usage: git-obs [global opts] pr [-h]
{cancel-scheduled-merge,checkout,close,comment,create,dump,get,show,list,merge,reopen,review,search,set,show-patch} ...

git-obs pr cancel-scheduled-merge

Cancel scheduled merge of pull requests

usage: git-obs [global opts] cancel-scheduled-merge [-h] id [id ...]

arguments:

Pull request ID in <owner>/<repo>#<number> format

git-obs pr checkout

Check out a pull request

usage: git-obs [global opts] checkout [-h] [-f] pull

arguments:

Number of the pull request

options:

Reset the existing local branch to the latest state of the pull request

git-obs pr close

Close pull requests

usage: git-obs [global opts] close [-h] [-m MESSAGE] id [id ...]

arguments:

Pull request ID in <owner>/<repo>#<number> format

options:

Text of the comment

git-obs pr comment

Comment pull requests

usage: git-obs [global opts] comment [-h] [-m MESSAGE] id [id ...]

arguments:

Pull request ID in <owner>/<repo>#<number> format

options:

Text of the comment

git-obs pr create

Create a pull request

usage: git-obs [global opts] create [-h] [--title TEXT] [--description TEXT]
[--source-owner OWNER]
[--source-repo REPO]
[--source-branch BRANCH]
[--target-branch BRANCH]

options:

Pull request title

Pull request description (body)

Owner of the source repo (default: derived from remote URL in local git repo)

Name of the source repo (default: derived from remote URL in local git repo)

Source branch (default: the current branch in local git repo)

Target branch (default: derived from the current branch in local git repo)

git-obs pr dump

Dump a pull request to disk

usage: git-obs [global opts] dump [-h] [--subdir-fmt FMT] id [id ...]

Return codes: - 0: default return code - 1-9: reserved for error states - 11: pull request(s) skipped due to no longer being open

arguments:

Pull request ID in <owner>/<repo>#<number> format

options:

Formatting string for a subdir associated with each pull request (default: '{pr.base_owner}/{pr.base_repo}/{pr.number}') Available values:
- 'pr' object which is an instance of 'osc.gitea_api.PullRequest'
- 'login_name', 'login_user' from the currently used Gitea login entry

git-obs pr get (show)

Get details about the specified pull requests

usage: git-obs [global opts] get [-h] [-p] [--timeline]
owner_repo_pull [owner_repo_pull ...]

arguments:

Owner, repo and pull request number (format: <owner>/<repo>#<pull-request-number>)

options:

Show patches associated with the pull requests

Show timelines of the pull requests

git-obs pr list

List pull requests in a repository

usage: git-obs [global opts] list [-h] [--state {open,closed,all}]
[--reviewer REVIEWERS]
[--review-state {REQUEST_REVIEW,APPROVED}]
[--target-branch TARGET_BRANCHES]
[--no-draft] [--export]
owner_repo [owner_repo ...]

arguments:

Owner and repo: (format: <owner>/<repo>)

options:

State of the pull requests (default: open)

Filter by reviewer. Team reviewers start with '@'.

Filter by review state. Needs to be used with ``--reviewer``.

Filter by target branch.

Filter by draft flag. Exclude pull requests with draft flag set.

Show json objects instead of human readable text

git-obs pr merge

Merge pull requests

usage: git-obs [global opts] merge [-h] [--now] id [id ...]

arguments:

Pull request ID in <owner>/<repo>#<number> format

options:

Merge immediately, don't wait until all checks succeed.

git-obs pr reopen

Reopen pull requests

usage: git-obs [global opts] reopen [-h] [-m MESSAGE] id [id ...]

arguments:

Pull request ID in <owner>/<repo>#<number> format

options:

Text of the comment

git-obs pr review

Manage pull request reviews

git-obs [global opts] review

usage: git-obs [global opts] review [-h] {approve,decline,interactive} ...

git-obs pr review approve

Approve pull request reviews

usage: git-obs [global opts] approve [-h] [-m MESSAGE] [--commit COMMIT]
[--reviewer REVIEWER]
id [id ...]

arguments:

Pull request ID in <owner>/<repo>#<number> format

options:

Justification of the review state change

Pin the review to the specified commit

Review on behalf of the specified reviewer that is associated to group review bot

git-obs pr review decline

Decline pull request reviews (request changes)

usage: git-obs [global opts] decline [-h] -m MESSAGE [--commit COMMIT]
[--reviewer REVIEWER]
id [id ...]

arguments:

Pull request ID in <owner>/<repo>#<number> format

options:

Justification of the review state change

Pin the review to the specified commit

Review on behalf of the specified reviewer that is associated to group review bot

git-obs pr review interactive

Interactive review of pull requests

usage: git-obs [global opts] interactive [-h] [--reviewer REVIEWER] [id ...]

Since this is an interactive command, the program return code indicates the user choice: - 0: default return code - 1-9: reserved for error states - 10: user selected "exit" - 11: user selected "skip"

This might be useful when wrapping the command in any external review tooling, handling one review at a time.

arguments:

Pull request ID in <owner>/<repo>#<number> format

options:

Review on behalf of the specified reviewer that is associated to group review bot

Search pull requests in the whole gitea instance

usage: git-obs [global opts] search [-h] [--state {open,closed}]
[--title TITLE] [--owner OWNER]
[--label LABEL] [--assigned] [--created]
[--mentioned] [--review-requested]
[--export]

options:

Filter by state: open, closed (default: open)

Filter by substring in title

Filter by owner of the repository associated with the pull requests

Filter by associated labels. Non existent labels are discarded. Can be specified multiple times.

Filter pull requests assigned to you

Filter pull requests created by you

Filter pull requests mentioning you

Filter pull requests requesting your review

Show json objects instead of human readable text

git-obs pr set

Change a pull request

usage: git-obs [global opts] set [-h] [--title TITLE]
[--description DESCRIPTION]
[--allow-maintainer-edit ALLOW_MAINTAINER_EDIT]
owner_repo_pull [owner_repo_pull ...]

arguments:

Owner, repo and pull request number (format: <owner>/<repo>#<pull-request-number>)

options:

Users with write access to the base branch can also push to the pull request's head branch

git-obs pr show-patch

Show patch associated to the specified pull request

usage: git-obs [global opts] show-patch [-h] owner_repo_pull

arguments:

Owner, repo and pull request number (format: <owner>/<repo>#<pull-request-number>)

git-obs repo

Manage git repos

git-obs [global opts] repo

usage: git-obs [global opts] repo [-h] {clone,fork,list} ...

git-obs repo clone

Clone a git repo

usage: git-obs [global opts] clone [-h] [-b BRANCH] [-a] [-i SSH_KEY]
[--no-ssh-strict-host-key-checking]
[--directory DIRECTORY]
owner_repo [owner_repo ...]

NOTE: Some of the options may result in setting "core.sshCommand" config option in the git repository."

arguments:

Owner and repo: (format: <owner>/<repo>)

options:

Checkout the specified branch

Clone anonymously via the http protocol

Path to a private SSH key (identity file)

Set 'StrictHostKeyChecking no' ssh option

Clone into the given directory

git-obs repo fork

Fork a git repo

usage: git-obs [global opts] fork [-h] [--new-repo-name NEW_REPO_NAME]
owner_repo [owner_repo ...]

arguments:

Owner and repo: (format: <owner>/<repo>)

options:

Name of the newly forked repo

git-obs repo list

List repos

usage: git-obs [global opts] list [-h] [--org ORG_LIST] [--user USER_LIST]
[--export]

Required permissions:
read:organization
read:user

options:

List repos owned by the specified organizations

List repos owned by the specified users

Show json objects instead of human readable text

git-obs ssh-key

Manage public SSH keys

git-obs [global opts] ssh-key

usage: git-obs [global opts] ssh-key [-h] {add,list,remove} ...

git-obs ssh-key add

usage: git-obs [global opts] add [-h] (--key KEY | --key-path PATH)

options:

SSH public key

Path to the SSH public key

git-obs ssh-key list

usage: git-obs [global opts] list [-h]

git-obs ssh-key remove

usage: git-obs [global opts] remove [-h] id

arguments:

Id of the SSH public key

AUTHOR

Contributors to the osc project. See the project's GIT history for the complete list.

DISTRIBUTION

The latest version of osc may be downloaded from https://github.com/openSUSE/osc/

2025-10-10 osc