osc cheatsheet for OBS

Open Build Service, OBS for short, uses osc as its CLI interface. osc is an SVN-like version control system with a good overview and a starter configuration guide on the openSUSE wiki.
On macOS you can install it via Homebrew.

$ brew install osc

To create a branch of a package, similar to a feature branch in Git:

$ osc branch <source project> <package>

Check out your local branch:

$ osc co <branched project>

Modified files are tracked automatically. To add new files and remove existing files:

$ osc add <file>
$ osc rm <file>

List changes:

$ osc st
$ osc diff

If you have a build pipeline set up, build your changes locally:

$ osc build

If you have vc, you can conveniently edit the changelog. Otherwise edit the .changes file manually (and carefully).

$ osc vc

osc has no staging, when you commit, changes are pushed to the remote. To commit:

$ osc ci

To submit a change request, akin to a PR, while keeping your branch:

$ osc sr --no-cleanup

To submit a change request from one build system to another:

$ osc -a <target build system> sr --no-cleanup <source build system>:<source project branch> <package> <target project>