Commands
>_
but rub
Combines two entities together to perform an operation like amend, squash, stage, or move.
The rub command is a simple verb that helps you do a number of editing
operations by doing combinations of two things.
For example, you can "rub" a file onto a branch to stage that file to the branch. You can also "rub" a commit onto another commit to squash them together. You can rub a commit onto a branch to move that commit. You can rub a file from one commit to another.
Operations Matrix
Each cell shows what happens when you rub SOURCE → TARGET:
Legend:
zzis a special target meaning "unassigned" (no branch)-means the operation is not supported- "all changes" / "all" refers to all uncommitted changes from that source
Examples
Squashing two commits into one (combining the commit messages):
Amending a commit with the contents of a modified file:
Moving a commit from one branch to another:
Usage: but rub <SOURCE> <TARGET>
Arguments
<SOURCE>— The source entity to combine (required)<TARGET>— The target entity to combine with the source (required)
Last updated on