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
玩法变了

玩法变了

胖胡斐 / 电子工业出版社 / 2012-1 / 39.00元

《玩法变了:淘宝卖家运赢弱品牌时代》内容简介:目前网店的销售、运营、营销都碰到很多瓶颈,钱不再好赚,流量不再免费的情况下。网店常常陷入不断找流量的怪圈中,而真正潜心提升基本功的网店却拥有更多机会,网店需要突围。《玩法变了:淘宝卖家运赢弱品牌时代》系统地介绍整个电子商务零售领域的玩法变化,从网店基本功到网店品牌建设都有涉及。《玩法变了:淘宝卖家运赢弱品牌时代》将是网店用户重要的方法论和实践指南。一起来看看 《玩法变了》 这本书的介绍吧!

在线进制转换器

在线进制转换器

各进制数互转换器

URL 编码/解码

URL 编码/解码

URL 编码/解码

UNIX 时间戳转换

UNIX 时间戳转换

UNIX 时间戳转换