stax - manage git branches and stack PRs
Homebrew is a package manager for MacOS.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install stax
brew install TarasMazepa/stax/stax
Chocolatey is a package manager for Windows.
Follow this guide to install chocolatey.
Install stax
choco install stax
Homebrew is a package manager for MacOS that also works on Linux systems.
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
Install stax
brew install TarasMazepa/stax/stax
Clone this repo and put the path to the repo into your PATH variable. You would need to have dart installed on your system.
Will help you to set up everything that stax needs to start working
stax doctor
[V] git config --get user.name # Taras Mazepa
[V] git config --get user.email # [email protected]
[V] git config --get push.autoSetupRemote # true
[V] git remote # remote(s): origin
[V] git rev-parse --abbrev-ref origin/HEAD # main
To see full list of commands, run:
stax help
Here is the list of commands currently available:
Creates branch, commits current changes with the same name as a branch, and pushes.
stax commit "two-in-one-commit-name-and-branch-name"
Result:
commit 8161c952fbed66672aff80cd3d1233589cdc3c0c (HEAD -> two-in-one-commit-name-and-branch-name, origin/two-in-one-commit-name-and-branch-name)
Author: Taras Mazepa <[email protected]>
Date: Fri Sep 8 14:58:04 2023 -0700
two-in-one-commit-name-and-branch-name
You can see that a branch with two-in-one-commit-name-and-branch-name
name was created as well as
a commit with the same name two-in-one-commit-name-and-branch-name
.
Amends to the current commit and force pushes the branch
stax amend
Deletes local branches with gone remotes. It is useful when you are using stax-commit
, which pushes all
the branches. So once they are merged and deleted from the remote, you can clean up local branches.
Switching to the main branch, pulling all the changes, deleting gone branches, and switching to the original branch.
Outputs tree structure of your branches.
> stax log
x Updates-stax-log-example-in-readme
o Adds-stax-log-example-to-readme
o-┘ origin/main, origin/HEAD, main
| o Promotes-version-command-to-be-not-hidden-command
o-┘
Rebase tree of nodes on top of the /head or reference provided as first positional argument.
Move has five directions:
up
— one node up. You can optionally specify the index of the child node (as represented in the log command); the default is 0.down
— one node uptop
— to the topmost node, but stop on the first node with more than one child. Optionally you can specify an index of the child node (as represented in log command), default is 0.bottom
— to the bottommost node, but stop on the first node that has more than one child, or stop before the node that had /head as a child.head
— moves to the /head
Checking out stacking workflow
- https://ejoffe.github.io/spr/
- https://git-town.com/
- https://gitbutler.com/
- https://github.com/VirtusLab/git-machete
- https://github.com/arxanas/git-branchless
- https://github.com/ezyang/ghstack
- https://github.com/gitext-rs/git-stack
- https://github.com/modularml/stack-pr
- https://graphite.dev/
- https://sapling-scm.com/
- https://stacked-git.github.io/