CLI shorthands¶
git-spice comes built-in with short versions of most commands
to make them easier to remember and type.
To determine the shorthand for a command,
run the command with the --help
flag.
The shorthand for a command is the bits in parentheses joined together.
For example, the shorthand for gs bc
.
Another example:
The shorthand for gs bco
.
When to use built-in shorthands?
We encourage adopting the built-in shorthands after you are comfortable with the corresponding full command names. The shorthands are designed to be easy to remember and type, but they may not be obvious if you don't know the full command name.
The shorthands act as a mnemonic aid: invoke the full command name in your head while typing the shorthand.
Built-in shorthands¶
Below is a complete list of shorthands built into git-spice.
Shorthand | Long form |
---|---|
gs bc | gs branch create |
gs bco | gs branch checkout |
gs bd | gs branch delete |
gs be | gs branch edit |
gs bfo | gs branch fold |
gs bon | gs branch onto |
gs br | gs branch restack |
gs brn | gs branch rename |
gs bs | gs branch submit |
gs bsp | gs branch split |
gs btr | gs branch track |
gs buntr | gs branch untrack |
gs ca | gs commit amend |
gs cc | gs commit create |
gs csp | gs commit split |
gs dse | gs downstack edit |
gs dss | gs downstack submit |
gs ll | gs log long |
gs ls | gs log short |
gs rba | gs rebase abort |
gs rbc | gs rebase continue |
gs ri | gs repo init |
gs rs | gs repo sync |
gs se | gs stack edit |
gs sr | gs stack restack |
gs ss | gs stack submit |
gs uso | gs upstack onto |
gs usr | gs upstack restack |
gs uss | gs upstack submit |
Custom shorthands¶
git-spice's configuration system supports defining
custom shorthands for git-spice commands
by setting configuration keys under the spice.shorthand
namespace.
spice.shorthand.<short> = <command> <arg> ...
Shorthands begin with the name of a git-spice command, followed by zero or more arguments to the command.
For example:
Overriding built-in shorthands¶
User-defined shorthands take precedence over built-in shorthands. You may use this to override a built-in shorthand with a custom one. For example:
If the result of a user-defined shorthand refers to a built-in shorthand, both will be expanded.