Skip to main content

git worktree untuk membuka banyak branch

· One min read
Wisnu Harjanta

move to root repo

git worktree <path for save worktree> <name branch>

example

git worktree .worktree/feature-jira345 feature-jira345

for switch worktree

cd .worktree/feature-jira345

and you can run terminal in directory

Remove worktreee

if worktree not use, you can delete worktree use command

git worktree remove .worktree/feature-jira345

Show list worktree

for show list worktree

git worktree list

Additional

sometime project not running normally, please check your .env. because .env file is ignore by git

Reference:

https://dev-notes.eu/2022/06/Branch-Management-With-Git-Worktree/ https://geekmonkey.org/rethink-your-git-workflow-with-git-worktree/ https://dev.to/yankee/practical-guide-to-git-worktree-58o0 https://www.gitkraken.com/learn/git/git-worktree