[英]How to archive diff files between two commit with jgit?
I'm trying to create an archive between two commits on my branch,but have no idea.. 我正在尝试在分支的两次提交之间创建一个存档,但是不知道。
here's my code: 这是我的代码:
ArchiveCommand.registerFormat("zip", new ZipArchiveFormat());
git.archive()
.setTree(repo.resolve("refs/heads/master^{tree}"))
.setFormat("zip")
.setOutputStream(new FileOutputStream(new File("test.zip")))
.call();
I use git command like this git archive --output=files.tar HEAD $(git diff-tree -r --no-commit-id --name-only --diff-filter=ACMRT 809365fe 7793cf5) how can I do this command with jGit? 我使用像这样的git命令git archive --output = files.tar HEAD $(git diff-tree -r --no-commit-id --name-only --diff-filter = ACMRT 809365fe 7793cf5)我该怎么办用jGit这个命令?
thanks for every reply! 感谢您的每一个答复!
You cannot archive diffs, neither with Git nor with JGit. 您不能使用Git或JGit存档差异文件。 An archive is always created from a tree. 归档总是从树中创建。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.