Skip to content

aaronhallaert/twt-cli

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

twt-cli: Tmux worktree CLI

A fuzzy finder based command line interface to switch, create and remove git worktrees with accompanying tmux windows written in Rust.

Usage

Create

twt-cli create [BRANCH_NAME]

If no branch is specified, the application fetches (with prune) and lists all remote branches. Pick one of the remote branches and a local branch is created with a worktree. In addition to all the git features, a new tmux window is created checked out at the new worktree.

Switch

twt-cli switch

This command shows all worktrees. If one is picked, the Tmux window will switch to the selected worktree.

Remove

twt-cli remove

This command shows all worktrees. If one is picked, the selected worktree is removed with the corresponding branch and if the Tmux window exists for this worktree, it will be deleted.

Git shortcuts

Backport

twt-cli backport <BRANCH_NAME> <FROM_COMMIT> [TO_COMMIT]

This command lists all remote release branches (hardcoded filter release/). The picked release branch(es) (select multiple with TAB) is used as the base of the new <BRANCH_NAME>. All commits from the given commits ([TO_COMMIT] is optional) are cherry-picked onto this new branch.

Note: The branch name should have the following format #{initials}/#{feature_name}. Release branches are expected to be of the following format release/#{release_id}. The backport branch will eventually have the name: #{initials}/#{release_id}-#{feature_name}.

Media

twt-cli.mov

Note

  • Upstream is hardcoded origin
  • / character in branches will be replaced by - in worktree names.
  • I work with an orphan branch instead of a bare repo for worktrees.
  • Link between a worktree and a branch is sometimes hardcoded by name. This can cause for unexpected behaviour if you check out a different branch in a worktree.

About

Tmux Worktree Cli

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages