本文翻译自:How to search for a commit message on GitHub?

不是在Git仓库中 ,而是在GitHub中 - 我如何只搜索特定仓库/分支的提交消息?


#1楼

参考:https://stackoom.com/question/1E2WS/如何在GitHub上搜索提交消息


#2楼

From the help page on searching code , it seems that this isn't yet possible. 从搜索代码的帮助页面看来,这似乎还不可能。

You can search for text in your repo, including the ability to choose files or paths to search in, but you can't specify that you want to search in commits. 您可以在回购中搜索文本,包括选择要搜索的文件或路径的功能,但不能指定要在提交中搜索。

Maybe suggest this to them ? 也许向他们提出这个建议 ?


#3楼

You used to be able to do this, but Github removed this feature at some point mid-2013. 您曾经能够这样做,但Github在2013年中期的某个时候删除了此功能。 To achieve this locally, you can do: 要在本地实现这一目标,您可以:

git log -g --grep=STRING

(Use the -g flag if you want to search other branches and dangling commits.) (如果要搜索其他分支和悬挂提交,请使用-g标志。)

-g, --walk-reflogsInstead of walking the commit ancestry chain, walk reflog entries fromthe most recent one to older ones.

#4楼

If you're working on Ubuntu (or perhaps other Unix OSes) and have a local version of the repo, you might want to try this crude shell script I wrote to open the GitHub pages for all commits matching your search term in new tabs in your default browser: 如果您正在使用Ubuntu(或者其他Unix操作系统)并拥有本地版本的repo,您​​可能需要尝试使用我编写的原始shell脚本来打开GitHub页面,以便在新标签中为您的搜索词匹配所有提交。您的默认浏览器:

#!/bin/sh
for sha1 in $(git rev-list HEAD -i --grep="$1"); dopython -mwebbrowser https://github.com/RepoOwnerUserName/RepoName/commit/$sha1 >/dev/null 2>/dev/null
done

Just replace https://github.com/RepoOwnerUserName/RepoName/ with the actual Github URL of your repo, save the script somewhere (eg as githubsearch.sh , make it executable ( chmod +x githubsearch.sh ) and then add the following alias to your ~/.bashrc file: 只需将https://github.com/RepoOwnerUserName/RepoName/替换为repo的实际Github URL,将脚本保存在某处(例如githubsearch.sh ,使其可执行( chmod +x githubsearch.sh )然后添加以下内容~/.bashrc文件的别名:

alias githubsearch='/path/to/githubsearch.sh'

Then, from anywhere in your git repo, just do this at the terminal: 然后,从您的git仓库中的任何位置,只需在终端执行此操作:

githubsearch "what you want to search for"

and any commits that match your (case insensitive) search term will have their corresponding GitHub pages opened in your browser. 任何符合您的(不区分大小写)搜索词的提交都将在浏览器中打开相应的GitHub页面。 (Be warned that if your search term appears in hundreds of commits, this may well crash your browser and eat your PC's CPU for a while.) (请注意,如果您的搜索词出现在数百个提交中,这可能会使您的浏览器崩溃,并暂时吃掉您PC的CPU。)

I've only tested this on Ubuntu and don't know enough about shell scripting to know whether this will work on other Unix-based OSes - particularly I don't know whether anything I've used here is Bash-specific. 我只在Ubuntu上测试了这个,并且对shell脚本知之甚少,不知道这是否适用于其他基于Unix的操作系统 - 特别是我不知道我在这里使用的是否是特定于Bash的。 Feel free to comment or edit to add compatibility info. 随意评论或编辑以添加兼容性信息。


#5楼

Update (2017/01/05): 更新(2017/01/05):
Github has published an update that allows you now to search within commit messages from within their UI. Github发布了一个更新,允许您现在在其UI中的提交消息中进行搜索。 See blog post for more information. 有关更多信息,请参阅博客文章


I had the same question and contacted someone @Github yesterday: 我有同样的问题,昨天联系了某人@Github:

Since they switched their search engine to ElasticSearch it's not possible to search for commit messages using the Github UI. 由于他们将搜索引擎切换到ElasticSearch,因此无法使用Github UI搜索提交消息。 But that feature is on the team's wishlist. 但该功能是在团队的愿望清单上。

Unfortunately there's no release date for that function right now. 不幸的是,目前还没有该功能的发布日期。


#6楼

This works well from within eclipse, until github adds the feature: 这在eclipse中很有效,直到github添加了这个功能:

https://wiki.eclipse.org/EGit/User_Guide#Searching_for_commits https://wiki.eclipse.org/EGit/User_Guide#Searching_for_commits

如何在GitHub上搜索提交消息?相关推荐

  1. 如何在GitHub上搜索

    参考地址:About searching on GitHub - GitHub Docs 中文地址:搜索代码 - GitHub Docs 高级搜索地址:https://github.com/searc ...

  2. 如何在 GitHub 上高效搜索开源项目

    GitHub 的流行及其在开源世界的受欢迎程度自不必多言.再加上近来GitHub 官方又搞了个大新闻:私有仓库也改为免费使用,这在原来可是需要真金白银买的.可见微软收购后,依然没有改变 GitHub ...

  3. 如何在 GitHub 上高效搜索开源项目(转载)

    如何在 GitHub 上高效搜索开源项目 查看全文 http://www.taodudu.cc/news/show-1347360.html 相关文章: Mybatis.cfg配置标签的顺序问题 To ...

  4. 你真的知道如何在 GitHub 上高效搜索开源项目吗?

    作者 | 侯树成 本文经授权转自Tomcat那些事儿 GitHub 的流行及其在开源世界的受欢迎程度自不必多言.再加上近来GitHub 官方又搞了个大新闻:私有仓库也改为免费使用,这在原来可是需要真金 ...

  5. git、github保姆级教程(手把手交)以及如何在github上提交pr,参与开源项目

    git.github保姆级教程(手把手交)以及如何在github上提交pr,参与开源项目 一.git的安装 直接参考 git官方网站:https://git-scm.com/ 二.git的使用(从新手 ...

  6. 如何在github上提交PR(Pull Request)

    github 上有很多优秀的开源项目,很多时候我们不仅仅只是满足于使用,同时也想一起参与开源项目的开发,贡献自己的代码.今天这篇文章就给大家介绍一下如何在 github 上提交 PR,让我们一起为开源 ...

  7. github 生产环境_如何在GitHub上提高生产力

    github 生产环境 by Darren Burns 达伦·伯恩斯(Darren Burns) 如何在GitHub上提高生产力 (How to be more productive on GitHu ...

  8. 如何在github上fork一个项目来贡献代码以及同步原作者的修改

    如何在github上fork一个项目来贡献代码以及同步原作者的修改 作为一个IT人,通过github进行学习是最快的成长手段.我们可以浏览别人的优秀代码.但只看不动手还是成长得很慢,因此为别人贡献代码 ...

  9. 你真的会高效的在GitHub上搜索开源项目吗?

    来源:Tomcat那些事 号外:最近整理了一下以前编写的一系列Spring Boot内容,整了个<Spring Boot基础教程>的PDF,关注我,回复:001,快来领取吧-!更多内容持续 ...

最新文章

  1. 高逼格的 SQL 写法:行行比较
  2. 2021语言与智能技术竞赛上线!百度飞桨提供平台算力支持
  3. 述职答辩提问环节一般可以问些什么_2020上海市职称评审答辩注意事项
  4. office软件的发展前景_2018年办公软件产业发展趋势
  5. ebs和java哪个前景好_EBS与实例存储的好处(反之亦然)[关闭]
  6. matlab程序怎么改,修改matlab程序
  7. 走进LWRP(Universal RP)的世界
  8. mysql 5.6密钥_MySQL的密钥文件不正确
  9. hadoop 替代方案_如何通过比较替代方案做出有效的决定
  10. 远程分支显示不全 idea_IDEA中的Git操作,看完你就会了
  11. Arthas : 在线分析诊断工具Arthas(阿尔萨斯)
  12. 【可行】adb修改手机代理方式
  13. 杭电OJ分类题目(4)-Graph
  14. Java中无法到达的语句
  15. Can't add self as subview crash错误
  16. 个人博客网站可以通过写系列连载文章来吸引用户
  17. 【雷达目标检测】恒定阈值法和恒虚警(CFAR)法及代码实现
  18. 【一年总结】记我的大一生活
  19. 一批信息查询网站汇总
  20. 教你如何搜索百度网盘的资源 百度网盘资源搜索方法!

热门文章

  1. iptables第二部分
  2. 【oracle ocp知识点一】
  3. 复合列NULL问题研究(转)
  4. nginx的指令root和alias的区别
  5. 用户界面和逻辑应该分离
  6. 聊聊 Python 的单元测试框架(一):unittest
  7. openfire源码编译后部署到linux
  8. day25 面向对象继承 多态
  9. yii 操作数据库的三种方法
  10. angularJS中搜索框的用法