简体   繁体   English

有没有办法只从远程存储库中提取提交消息?

[英]Is there a way to pull just the commit messages from a remote repository?

I've got a script that basically analyzes the commit messages in a given remote repository. 我有一个脚本,该脚本基本上可以分析给定远程存储库中的提交消息。

My current implementation clones the remote repository, then iterates through each branch, running the "git whatchanged" command. 我当前的实现是克隆远程存储库,然后遍历每个分支,运行“ git whatchanged”命令。

If all I need are the commit messages, is there any way I could go about doing so without having to clone the repository? 如果我只需要提交消息,是否有什么方法可以不必克隆存储库呢? I think this would speed the script up considerably. 我认为这将大大加快脚本的速度。

I don't believe that git provides a mechanism for remotely iterating over a repository. 我不相信git提供了一种在存储库上进行远程迭代的机制。 If you keep a cached working directory locally, so that instead of re-cloning the entire you're simply applying updates, then you shouldn't have speed problems. 如果您在本地保留一个缓存的工作目录,那么不必重新克隆整个目录,而只需应用更新,那么就不会遇到速度问题。

If your remote repository happens to be on github , then they have a remote HTTP API for interacting with a repository that may make what you describe possible. 如果您的远程存储库恰好位于github ,则它们具有用于与存储库进行交互的远程HTTP API ,这可能使您所描述的成为可能。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM