git worktree add <dir> <branch> 命令详解

把另一分支检出到独立目录

命令语法
git worktree add <dir> <branch>
命令说明
把另一分支检出到独立目录
示例
$ git worktree add ../hotfix main
其他实用命令相关命令

git worktree add <dir> <branch> 用法说明

git worktree add <dir> <branch> 是「其他实用命令」分类下的常用命令,作用是:把另一分支检出到独立目录。

典型用法如下:git worktree add ../hotfix main。你可以查看本页上方同组的相关命令,或直接复制到终端运行。

常见问题解答

git worktree add <dir> <branch> 是什么?
git worktree add <dir> <branch> 用于把另一分支检出到独立目录,属于「其他实用命令」相关命令。
git worktree add <dir> <branch> 怎么用?
在终端执行 git worktree add ../hotfix main 即可,具体参数请按实际环境调整。
还有哪些相关命令?
其他实用命令分类下还有 11 条相关命令,见本页上方「相关命令」。

同类工具