- I'm test it worked on bash maybe zsh will work.
- Fish and other shell can be support later if i not lazy, pull request are welcome🫰
- Video: https://youtu.be/B39zBcK6x5w
curl --remote-name https://raw.githubusercontent.com/thuanowa/git_worktree_fzf/master/git_worktree_fzf.bash > ~/.local/share/git_worktree_fzf.bash
echo "source ~/.local/share/git_worktree_fzf.bash" >> ~/.bashrc
source ~/.bashrc
OR
- Just add this git_worktree_fzf.bash on your bash config
worktree will be stored at .worktrees
:
git_folder
--- README.md
--- .worktrees/feat/here
--- .worktrees/tmp
Ignore .worktrees/
globally
~/.gitconfig
[core]
excludesfile = ~/.gitignore
~/.gitignore
.worktrees/
Function
- The script have 2 functions:
- fzf_git_worktree_change_dir
- fzf_git_worktree_remove
- you can make the alias of that like me.
alias w="fzf_git_worktree_change_dir"
alias ww="fzf_git_worktree_remove"
- Show all your git worktree
- Search your worktrees with fzf
- if had, change dir to your worktree location
- if the name of worktree you type don't have -> just press
enter
it will create new git worktree with the name you provice for you.
- Show all your git worktree
- Search your worktrees with fzf, find the worktree you want remove, press enter will remove this worktree