Git worktree 命令

更新时间: 2019-07-13 17:17

git-worktree - Manage multiple working trees

语法

git worktree add [-f] [--detach] [--checkout] [--lock] [-b <new-branch>] <path> [<branch>]
git worktree list [--porcelain]
git worktree lock [--reason <string>] <worktree>
git worktree prune [-n] [-v] [--expire <expire>]
git worktree unlock <worktree>

参数

-f, --force
    By default, add refuses to create a new working tree when <branch> is already checked out by another working tree. This option
    overrides that safeguard.

-b <new-branch>, -B <new-branch>
    With add, create a new branch named <new-branch> starting at <branch>, and check out <new-branch> into the new working tree. If
    <branch> is omitted, it defaults to HEAD. By default, -b refuses to create a new branch if it already exists.  -B overrides this
    safeguard, resetting <new-branch> to <branch>.

--detach
    With add, detach HEAD in the new working tree. See "DETACHED HEAD" in git-checkout(1).

--[no-]checkout
    By default, add checks out <branch>, however, --no-checkout can be used to suppress checkout in order to make customizations, such
    as configuring sparse-checkout. See "Sparse checkout" in git-read-tree(1).

--lock
    Keep the working tree locked after creation. This is the equivalent of git worktree lock after git worktree add, but without race
    condition.

-n, --dry-run
    With prune, do not remove anything; just report what it would remove.

--porcelain
    With list, output in an easy-to-parse format for scripts. This format will remain stable across Git versions and regardless of user
    configuration. See below for details.

-v, --verbose
    With prune, report all removals.

--expire <time>
    With prune, only expire unused working trees older than <time>.

--reason <string>
    With lock, an explanation why the working tree is locked.

<worktree>
    Working trees can be identified by path, either relative or absolute.

    If the last path components in the working tree's path is unique among working trees, it can be used to identify worktrees. For
    example if you only have two working trees, at "/abc/def/ghi" and "/abc/def/ggg", then "ghi" or "def/ghi" is enough to point to the
    former working tree.

查看更多 git worktree 命令的使用方法,可以使用命令:

git help worktree
蚁群算法原理及其应用

蚁群算法原理及其应用

段海滨 / 科学出版社 / 2005年2月1日 / 48.0

《蚁群算法原理及其应用(精装)》系统、深入地介绍了蚁群算法的原理及其应用,力图概括国内外在这一学术领域的最新研究进展。全书共包括10章,主要内容包括蚁群算法的思想起源、研究现状及机制原理;蚁群算法的复杂度分析;蚁群算法的收敛性证明;蚁群算法参数对其性能的影响;蚁群算法的参数选择原则;离散域和连续域蚁群算法的若干改进策略;蚁群算法在多个优化领域的典型应用;蚁群算法的硬件实现技术;蚁群算法与其他仿生优......一起来看看 《蚁群算法原理及其应用》 这本书的介绍吧!

JSON 在线解析

JSON 在线解析

在线 JSON 格式化工具

随机密码生成器

随机密码生成器

多种字符组合密码

HEX CMYK 转换工具

HEX CMYK 转换工具

HEX CMYK 互转工具