TIL: Git worktree

# Create a new branch called "experimental" and switch to it
git checkout -b experimental

# Create a new working directory for the "experimental" branch
git worktree add ../experimental-dir experimental

# Switch to the new working directory
cd ../experimental-dir

# Make some changes and commit them
...

# Switch back to the main working directory
cd ../main-dir

# Merge the changes from the "experimental" branch
git merge experimental

posted @ 2022-12-15 22:53  talentzemin  阅读(14)  评论(0编辑  收藏  举报