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
平台转型

平台转型

陈威如、王诗一、余卓轩(统筹) / 中信出版社 / 2016-1-10 / 58

《平台战略》续篇,陈威如等关于企业平台转型最新力作! 平台带来的商业革命已改写了现在及未来的企业生存规则,而这股浪潮已经从互联网行业漫延到了其他多种行业之中!如果说,过去10 年是平台商业模式在互联网行业的爆发期,那未来10 年,将是平台商业模式在传统行业转型应用上的黄金时代。 平台思维不再是互联网行业的专用词,它可以用来解构价值链,可以被运用到组织架构的设计中,更能够帮助企业升级竞争......一起来看看 《平台转型》 这本书的介绍吧!

Base64 编码/解码

Base64 编码/解码

Base64 编码/解码

html转js在线工具

html转js在线工具

html转js在线工具

RGB CMYK 转换工具

RGB CMYK 转换工具

RGB CMYK 互转工具