ruby中如何显示commit内容
如何在 Ruby on Rails 应用程序中显示使用 SHA-1 指定的提交内容?
How do you display the commit content specified with SHA-1 in a Ruby on Rails application?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
有一个很好的图书馆可以做到这一点。将其包含在您的 gemfile 中并查看文档以了解如何实现。
https://github.com/schacon/ruby-git
There's a good library for this. Include it in your gemfile and look at the docs for how to implement.
https://github.com/schacon/ruby-git
作为免责声明,我不确定这是否是您问题的答案,但我会告诉您我所知道的:
在控制台(显然是您项目的文件夹)中,您可以获得已更改的文件列表,他们即将提交的状态为:
要获取确切的代码更改的读数,您可以在控制台中输入:
希望有帮助!
As a disclaimer I'm not sure if this is an answer to your question but I'll give you what I know:
In the console (folder for your project, obviously), you can get a list of the files you have changed and their status for your upcoming commit with:
To get a readout of the exact code changes, you can type into the console:
Hope that helps!
只需使用 grit:
然后就可以使用返回的提交对象。请查看 http://grit.rubyforge.com/。如果你想查看该提交更改的文件,你可以这样做
Just use grit:
Then just play with the commit object returned. Check out http://grit.rubyforge.com/. If you want to see the changed files by that commit you can do