Skip to content

YlanAllouche/treemux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

treemux

A tmux plugin for switching git branches and managing git worktrees from a popup with fzf.

Installation

Add the plugin to ~/.tmux.conf:

set -g @plugin 'YlanAllouche/treemux'

Reload tmux and install plugins with prefix + I.

This replaces:

bind-key b display-popup -E -w 80% -h 60% -d '#{pane_current_path}' "~/.local/bin/git-branch-switcher"
bind-key B display-popup -E -w 80% -h 60% -d '#{pane_current_path}' "~/.local/bin/git-branch-switcher --delete"

Defaults

  • prefix + b opens branch switching mode.
  • prefix + B opens delete mode.
  • Popup width is 80%.
  • Popup height is 60%.

Configuration

set -g @treemux_key 'b'
set -g @treemux_delete_key 'B'
set -g @treemux_width '80%'
set -g @treemux_height '60%'
set -g @treemux_python 'python3'
set -g @treemux_base_branch ''
set -g @treemux_debug '0'

Set @treemux_key or @treemux_delete_key to none to disable a binding.

@treemux_base_branch overrides automatic default-branch detection.

@treemux_debug writes logs to /tmp/git-branch-switcher.log.

Behavior

  • In a regular repository, it switches to an existing branch or creates a new one.
  • In bare repositories and linked worktrees, it manages worktrees under <bare-repo>/workspaces.
  • Delete mode deletes the local branch in a regular repository.
  • Delete mode removes only the worktree in bare and linked-worktree mode.
  • When a new tmux window is created for a worktree, the plugin opens $EDITOR there.

The plugin still honors GBS_BASE, GBS_BASE_BRANCH, GBS_DEBUG, and GBS_DELETE if they are already part of your setup.

Requirements

  • tmux with display-popup support
  • git
  • fzf
  • bash
  • Python 3.8+

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors