Skip to content

Worktrunk is a CLI for Git worktree management, designed for parallel AI agent workflows

feat: Remove `wt push` command

Maximilian Roos587572561908
diff --git a/README.md b/README.md
index f02ea82de..e3e4bb7ae 100644
--- a/README.md
+++ b/README.md
@@ -90,7 +90,6 @@ These trade manual control for automation. For fine-grained control, use `git wo
- `wt switch --create [branch]` - Create and switch
- `wt remove` - Remove current, return to main
- `wt merge [target]` - Merge, push, cleanup
-- `wt push [target]` - Move changes to another branch
- `wt list` - Show all worktrees
- `wt config` - Manage configuration
@@ -303,17 +302,6 @@ worktree-path = ".worktrees/{branch}"
worktree-path = "../worktrees/{main-worktree}/{branch}"
```
-### Fast Branch Switching
-
-Push changes from the current worktree directly to another branch without committing or merging. Useful for moving work-in-progress code.
-
-```bash
-# Push current changes to another branch
-$ wt push feature-experiment
-```
-
-Worktrunk stages the changes, creates a commit, and pushes it to the target branch's worktree if it exists.
-
### Shell Integration Details
Worktrunk automatically configures your shell:
diff --git a/src/commands/mod.rs b/src/commands/mod.rs
index 475f42d23..ce76a495f 100644
--- a/src/commands/mod.rs
+++ b/src/commands/mod.rs
@@ -21,7 +21,7 @@ pub use dev::{
pub use init::handle_init;
pub use list::handle_list;
pub use merge::handle_merge;
-pub use worktree::{handle_push, handle_remove, handle_switch};
+pub use worktree::{handle_remove, handle_switch};
// Re-export Shell from the canonical location
pub use worktrunk::shell::Shell;
diff --git a/src/main.rs b/src/main.rs
index 78d8c0029..65b446f2e 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -15,7 +15,7 @@ use commands::{
ConfigAction, Shell, handle_complete, handle_completion, handle_config_help,
handle_config_init, handle_config_list, handle_config_refresh_cache, handle_configure_shell,
handle_dev_commit, handle_dev_push, handle_dev_rebase, handle_dev_run_hook, handle_dev_squash,
- handle_init, handle_list, handle_merge, handle_push, handle_remove, handle_switch,
+ handle_init, handle_list, handle_merge, handle_remove, handle_switch,
};
use output::{handle_remove_output, handle_switch_output};
@@ -204,16 +204,6 @@ enum Commands {
worktrees: Vec<String>,
},
- /// Push changes between worktrees
- Push {
- /// Target branch (defaults to default branch)
- target: Option<String>,
-
- /// Allow pushing merge commits (non-linear history)
- #[arg(long)]
- allow_merge_commits: bool,
- },
-
/// Merge worktree into target branch
#[command(long_about = "Merge worktree into target branch
@@ -534,10 +524,6 @@ fn main() {
})()
}
}
- Commands::Push {
- target,
- allow_merge_commits,
- } => handle_push(target.as_deref(), allow_merge_commits, "Pushed to"),
Commands::Merge {
target,
squash_enabled,
diff --git a/tests/integration_tests/completion.rs b/tests/integration_tests/completion.rs
index 866465b1a..392e512ed 100644
--- a/tests/integration_tests/completion.rs
+++ b/tests/integration_tests/completion.rs
@@ -91,20 +91,17 @@ fn test_complete_push_shows_all_branches() {
.output()
.unwrap();
- // Test completion for push (should show ALL branches, including those with worktrees)
+ // Test completion for dev push (should show ALL branches, including those with worktrees)
let mut settings = Settings::clone_current();
settings.set_snapshot_path("../snapshots");
settings.bind(|| {
let mut cmd = Command::new(get_cargo_bin("wt"));
cmd.current_dir(temp.root_path())
- .args(["complete", "wt", "push", ""]);
+ .args(["complete", "wt", "dev", "push", ""]);
assert_cmd_snapshot!(cmd, @r"
success: true
exit_code: 0
----- stdout -----
- feature/new
- hotfix/bug
- main
----- stderr -----
");
@@ -538,13 +535,19 @@ fn test_complete_stops_after_branch_provided() {
");
});
- // Test that push stops completing after branch is provided
+ // Test that dev push stops completing after branch is provided
let mut settings = Settings::clone_current();
settings.set_snapshot_path("../snapshots");
settings.bind(|| {
let mut cmd = Command::new(get_cargo_bin("wt"));
- cmd.current_dir(temp.root_path())
- .args(["complete", "wt", "push", "feature/one", ""]);
+ cmd.current_dir(temp.root_path()).args([
+ "complete",
+ "wt",
+ "dev",
+ "push",
+ "feature/one",
+ "",
+ ]);
assert_cmd_snapshot!(cmd, @r"
success: true
exit_code: 0
diff --git a/tests/integration_tests/push.rs b/tests/integration_tests/push.rs
index 556a7cf52..728429be2 100644
--- a/tests/integration_tests/push.rs
+++ b/tests/integration_tests/push.rs
@@ -6,7 +6,10 @@ use std::process::Command;
fn snapshot_push(test_name: &str, repo: &TestRepo, args: &[&str], cwd: Option<&std::path::Path>) {
let settings = setup_snapshot_settings(repo);
settings.bind(|| {
- let mut cmd = make_snapshot_cmd(repo, "push", args, cwd);
+ // Prepend "push" to args for `wt dev push` command
+ let mut dev_args = vec!["push"];
+ dev_args.extend_from_slice(args);
+ let mut cmd = make_snapshot_cmd(repo, "dev", &dev_args, cwd);
assert_cmd_snapshot!(test_name, cmd);
});
}
diff --git a/tests/snapshots/integration__integration_tests__init__init_bash.snap b/tests/snapshots/integration__integration_tests__init__init_bash.snap
index 66a0f48cd..8f059d9c8 100644
--- a/tests/snapshots/integration__integration_tests__init__init_bash.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_bash.snap
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmp4mPiBI/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpo3IbDR/test-config.toml
---
success: true
exit_code: 0
@@ -178,9 +178,6 @@ _wt() {
wt,merge)
cmd="wt__merge"
;;
- wt,push)
- cmd="wt__push"
- ;;
wt,remove)
cmd="wt__remove"
;;
@@ -224,7 +221,7 @@ _wt() {
case "${cmd}" in
wt)
- opts="-v -h -V --verbose --help --version init config dev list switch remove push merge completion complete"
+ opts="-v -h -V --verbose --help --version init config dev list switch remove merge completion complete"
if [[ ${cur} == -* || ${COMP_CWORD} -eq 1 ]] ; then
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
@@ -483,20 +480,6 @@ _wt() {
COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
return 0
;;
- wt__push)
- opts="-v -h --allow-merge-commits --verbose --help [TARGET]"
- if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- fi
- case "${prev}" in
- *)
- COMPREPLY=()
- ;;
- esac
- COMPREPLY=( $(compgen -W "${opts}" -- "${cur}") )
- return 0
- ;;
wt__remove)
opts="-v -h --verbose --help [WORKTREES]..."
if [[ ${cur} == -* || ${COMP_CWORD} -eq 2 ]] ; then
diff --git a/tests/snapshots/integration__integration_tests__init__init_fish.snap b/tests/snapshots/integration__integration_tests__init__init_fish.snap
index 92a7a9d2e..94773d54a 100644
--- a/tests/snapshots/integration__integration_tests__init__init_fish.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_fish.snap
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpH7LwKy/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpLhXsKg/test-config.toml
---
success: true
exit_code: 0
@@ -174,7 +174,6 @@ if type -q wt; or set -q WORKTRUNK_BIN
complete -c wt -n '__fish_seen_subcommand_from dev; and __fish_seen_subcommand_from rebase' -f -a '(__wt_complete)' -d 'Target branch to rebase onto (defaults to default branch)'
complete -c wt -n '__fish_seen_subcommand_from switch' -f -a '(__wt_complete)' -d 'Branch name or worktree path'
complete -c wt -n '__fish_seen_subcommand_from remove' -f -a '(__wt_complete)' -d 'Worktree names or branches to remove (defaults to current worktree if none specified)'
- complete -c wt -n '__fish_seen_subcommand_from push' -f -a '(__wt_complete)' -d 'Target branch (defaults to default branch)'
complete -c wt -n '__fish_seen_subcommand_from merge' -f -a '(__wt_complete)' -d 'Target branch to merge into (defaults to default branch)'
complete -c wt -n '__fish_seen_subcommand_from completion' -f -a '(__wt_complete)' -d 'Shell to generate completions for'
complete -c wt -n '__fish_seen_subcommand_from complete' -f -a '(__wt_complete)' -d 'Arguments to complete'
@@ -216,7 +215,6 @@ complete -c wt -n "__fish_wt_needs_command" -f -a "dev" -d 'Development and test
complete -c wt -n "__fish_wt_needs_command" -f -a "list" -d 'List all worktrees'
complete -c wt -n "__fish_wt_needs_command" -f -a "switch" -d 'Switch to a worktree'
complete -c wt -n "__fish_wt_needs_command" -f -a "remove" -d 'Finish current worktree, returning to primary if current'
-complete -c wt -n "__fish_wt_needs_command" -f -a "push" -d 'Push changes between worktrees'
complete -c wt -n "__fish_wt_needs_command" -f -a "merge" -d 'Merge worktree into target branch'
complete -c wt -n "__fish_wt_using_subcommand init" -s v -l verbose -d 'Enable verbose output (show git commands and debug info)'
complete -c wt -n "__fish_wt_using_subcommand init" -s h -l help -d 'Print help'
@@ -285,9 +283,6 @@ complete -c wt -n "__fish_wt_using_subcommand switch" -s v -l verbose -d 'Enable
complete -c wt -n "__fish_wt_using_subcommand switch" -s h -l help -d 'Print help'
complete -c wt -n "__fish_wt_using_subcommand remove" -s v -l verbose -d 'Enable verbose output (show git commands and debug info)'
complete -c wt -n "__fish_wt_using_subcommand remove" -s h -l help -d 'Print help'
-complete -c wt -n "__fish_wt_using_subcommand push" -l allow-merge-commits -d 'Allow pushing merge commits (non-linear history)'
-complete -c wt -n "__fish_wt_using_subcommand push" -s v -l verbose -d 'Enable verbose output (show git commands and debug info)'
-complete -c wt -n "__fish_wt_using_subcommand push" -s h -l help -d 'Print help'
complete -c wt -n "__fish_wt_using_subcommand merge" -l no-squash -d 'Disable squashing commits (by default, commits are squashed into one before merging)'
complete -c wt -n "__fish_wt_using_subcommand merge" -s k -l keep -d 'Keep worktree after merging (don\'t remove)'
complete -c wt -n "__fish_wt_using_subcommand merge" -l no-verify -d 'Skip all project hooks (pre-merge-command)'
diff --git a/tests/snapshots/integration__integration_tests__init__init_zsh.snap b/tests/snapshots/integration__integration_tests__init__init_zsh.snap
index b68fe99cf..10b5dbc5e 100644
--- a/tests/snapshots/integration__integration_tests__init__init_zsh.snap
+++ b/tests/snapshots/integration__integration_tests__init__init_zsh.snap
@@ -16,7 +16,7 @@ info:
LANG: C
LC_ALL: C
SOURCE_DATE_EPOCH: "1761609600"
- WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpb12hgn/test-config.toml
+ WORKTRUNK_CONFIG_PATH: /var/folders/wf/s6ycxvvs4ln8qsdbfx40hnc40000gn/T/.tmpYlKodK/test-config.toml
---
success: true
exit_code: 0
@@ -337,16 +337,6 @@ _arguments "${_arguments_options[@]}" : \
'*::worktrees -- Worktree names or branches to remove (defaults to current worktree if none specified):_default' \
&& ret=0
;;
-(push)
-_arguments "${_arguments_options[@]}" : \
-'--allow-merge-commits[Allow pushing merge commits (non-linear history)]' \
-'-v[Enable verbose output (show git commands and debug info)]' \
-'--verbose[Enable verbose output (show git commands and debug info)]' \
-'-h[Print help]' \
-'--help[Print help]' \
-'::target -- Target branch (defaults to default branch):_default' \
-&& ret=0
-;;
(merge)
_arguments "${_arguments_options[@]}" : \
'--no-squash[Disable squashing commits (by default, commits are squashed into one before merging)]' \
@@ -395,7 +385,6 @@ _wt_commands() {
'list:List all worktrees' \
'switch:Switch to a worktree' \
'remove:Finish current worktree, returning to primary if current' \
-'push:Push changes between worktrees' \
'merge:Merge worktree into target branch' \
'completion:Generate shell completion script (deprecated - use init instead)' \
'complete:Internal completion helper (hidden)' \
@@ -499,11 +488,6 @@ _wt__merge_commands() {
local commands; commands=()
_describe -t commands 'wt merge commands' commands "$@"
}
-(( $+functions[_wt__push_commands] )) ||
-_wt__push_commands() {
- local commands; commands=()
- _describe -t commands 'wt push commands' commands "$@"
-}
(( $+functions[_wt__remove_commands] )) ||
_wt__remove_commands() {
local commands; commands=()