【问题标题】:git archive --format=tar HEAD:mydir/ | tar t -> fatal: current working directory is untrackedgit 存档 --format=tar HEAD:mydir/ | tar t -> 致命:当前工作目录未跟踪
【发布时间】:2015-05-28 21:41:55
【问题描述】:

我正在尝试在我的 git 存储库中存档一个文件夹:

git archive --format=tar HEAD:mydir/ | tar t

但是,我收到的错误消息是:

fatal: current working directory is untracked

我遵循的说明是here

我的git版本是:2.1.2

google 搜索只找到了 6 个链接,所有这些链接都是几年前的,看起来并不相关。

【问题讨论】:

    标签: macos git


    【解决方案1】:

    解决办法是:

    cd $myrepo/mydir
    git archive --format=tar  HEAD ./ | tar t
    

    【讨论】:

    • 是的,我也认为HEAD:中冒号后面的路径实际上是来自git根目录的完整路径,结果它是相对于当前位置的,然后......(但只有当冒号未使用,因为您已发布)
    猜你喜欢
    • 1970-01-01
    • 2017-04-20
    • 2011-08-07
    • 2014-09-28
    • 1970-01-01
    • 1970-01-01
    • 2022-07-06
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多