Git Worktree for a cheeky rebase
Let’s say you are at the end of a sprint and you want to rebase your Release branch on to staging, but you don’t want to switch branches in the project directory, because you have uncommitted changes or you are running tests, or anything that changing directory might disrupt.
git worktree add ../release-temp
# Open a new terminal, e.g. in TMUX
cd ../release-temp
git checkout release-branch
git rebase staging
exit
# close the terminal, and back in the original project directory
git worktree remove ../release-temp
Published on 21 Aug 2026
all tags
100daysofcode activerecord ai android annoyances api apt arch array artix atom az3w backend bash blog browser bug callback career ci-cd claude cli cloud code coding config configuration cp crud cryptography css csv database db demo design development devops django docker email erp feelsgood filter fugitive gif gist git github gmail gnome gnome pomodoro grep hebrew http ide isbn-fetcher iso javascript job search js kanban kindle koans learning linkedin linux llm logger manjaro map markdown microservices mobi mtp neovim nodejs nvchad packages panda pastbin patch portfolio post postgres pytest python rails rebase reduce refactoring reflections rest routes rspec ruby salesforce script scripting security sed shell sql string_replacement study tasks tdd terminal testing tmux ttd version_control vim vim sort walkthrough wayland webdev workflow worktree xorg zsh