Java/JGit:如何在不影响某些目录的情况下获得Git提交?
使用Git,我可以通过以下命令获得影响路径的提交: 我还可以获得目录中未发生的提交(根据此处的SO答案:): JGit是Git的Java实现,它提供了log命令的实现,但是它只提供了前一个(包含)log命令的变体,而不是独占版本():Java/JGit:如何在不影响某些目录的情况下获得Git提交?,java,git,jgit,Java,Git,Jgit,使用Git,我可以通过以下命令获得影响路径的提交: 我还可以获得目录中未发生的提交(根据此处的SO答案:): JGit是Git的Java实现,它提供了log命令的实现,但是它只提供了前一个(包含)log命令的变体,而不是独占版本(): 有没有一种方法可以让我使用Java获得不影响路径的提交列表(例如,git log--.:(exclude)sub“),而不需要我向git本身付费?我不确定这是否可行,因此我通过Gerrit向JGit项目提交了一份PR: # show commits affecti
有没有一种方法可以让我使用Java获得不影响路径的提交列表(例如,
git log--.:(exclude)sub“
),而不需要我向git
本身付费?我不确定这是否可行,因此我通过Gerrit向JGit项目提交了一份PR:
# show commits affecting the `sub` directory
git log -- . "sub"
git log -- . ":(exclude)sub"
git log -- . ":!sub"
git log -- . ":^sub"
public LogCommand addPath(String path)
// Show only commits that affect any of the specified paths. The path must either name a file or a directory exactly and use / (slash) as separator. Note that regex expressions or wildcards are not supported.
Parameters:
path - a repository-relative path (with / as separator)
Returns:
this