【问题标题】:How to archive diff files between two commit with jgit?如何使用 jgit 归档两次提交之间的差异文件?
【发布时间】:2017-06-23 05:30:31
【问题描述】:

我正在尝试在我的分支上的两个提交之间创建一个存档,但不知道..

这是我的代码:

ArchiveCommand.registerFormat("zip", new ZipArchiveFormat());                 
git.archive()
.setTree(repo.resolve("refs/heads/master^{tree}"))
.setFormat("zip")
.setOutputStream(new FileOutputStream(new File("test.zip")))
.call();

我使用这样的 git 命令 git archive --output=files.tar HEAD $(git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT 809365fe 7793cf5) 如何我可以用 jGit 执行此命令吗?

感谢您的每一个回复!

【问题讨论】:

    标签: java jgit


    【解决方案1】:

    您无法归档差异,无论是使用 Git 还是使用 JGit。档案总是从树中创建的。

    【讨论】:

    • 我使用这样的 git 命令git archive --output=files.tar HEAD $(git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT 809365fe 7793cf5) 我如何使用 jGit 执行此命令?谢谢
    • 为了得到答案,您应该根据这些要求编辑问题
    猜你喜欢
    • 2015-05-14
    • 2012-06-06
    • 2015-05-01
    • 1970-01-01
    • 1970-01-01
    • 2015-02-06
    • 2021-09-12
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多