切分支要先提交或暂存,用 worktree 可以把另一个分支检到独立目录,两边互不干扰。
在仓库根目录执行 worktree add 指定新目录和分支,编译和调试可以并行跑,不用等对方。
用 list 查看所有工作树,分支合并完用 remove 清理目录,再跑一次 prune 收尾。
git worktree add ../hotfix -b hotfix/1.2.3
git worktree list
git worktree remove ../hotfix
git worktree prune
THE END






暂无评论内容