【问题标题】:GIT: Get commits for specific path in mono repoGIT:在单声道回购中获取特定路径的提交
【发布时间】:2018-12-16 12:58:18
【问题描述】:

我有一个包含许多项目的 monorepo,我想获取特定项目的所有提交。

例如:我有 github.com/owner/repo,在此之下我有目录、Web、移动设备和服务器。 我想从 Github API 获取一个项目的所有提交。 不幸的是,我没有找到办法……

【问题讨论】:

  • 这个需要github api吗?如果您克隆存储库并使用git log --follow mobile,您应该拥有移动目录的所有提交
  • 是的,它必须在 Github API 中。我正在比较两个标签,我只想要相关的提交

标签: git github github-api


【解决方案1】:

我也不知道这是否可以通过 GitHub API 实现,但是如果您在本地克隆该存储库并使用 Git CLI,那么一切都很简单:

git clone https://github.com/example/example
cd example
git log --follow --pretty=%H -- <folder>

这将列出 &lt;folder&gt; 中的任何文件发生更改的所有提交 SHA。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-09-19
    • 2014-10-29
    • 2017-10-22
    • 2017-02-18
    • 2015-01-10
    • 2012-12-31
    • 1970-01-01
    • 2018-04-05
    相关资源
    最近更新 更多