浏览同一存储库的两个不同版本
假设我有一个相当大的存储库,并且我想比较两个特定的修订版。但不仅仅是想看看差异,我希望能够浏览代码、在文件之间跳转等。
一个例子可能是同时打开 Rails 2.3 和 3,并查看相同的不同实现事物。
我现在执行此操作的方法只是本地克隆,在每个版本中签出不同的版本,在我的编辑器(SublimeText)中打开它们并浏览。
有没有更好的方法来做到这一点?有没有任何工具可以让这变得更容易?
Say that I have a rather large repository, and I want to compare two specific revisions. But don't just want to just see the diff, I want to be able to browse through the code, jump between files etc.
An example might be opening up Rails 2.3 and 3 at the same time and looking at different implementation of the same thing.
The way I do this now is just a local clone, checkout a different version in each, open them both in my editor (SublimeText) and browse.
Is there any better way to do this? Are there any tools that make this easier?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只有一个工作目录,并且您想要在那里放两个修订版?不去上班。
可以设置一个简单的基于 Web 的服务器来探索存储库,然后您可以打开两个浏览器选项卡/窗口并检查不同版本的代码。有关如何设置 GitWEB 的说明位于此处。 git.kernel.org 使用它,因此要了解它的外观,您可以打开任何存储库 http://git.kernel.org/?p=git/git.git;a=summary。
There's only one working directory, and you want to put two revisions there? Not going to work.
It possible to setup a simple web-based server to explore the repository, and then you could open two browser tabs/windows and inspect the code at different revisions. Instructions on how to setup GitWEB are here. git.kernel.org uses this, so to have get a feeling on how it looks like you can open any of the repos http://git.kernel.org/?p=git/git.git;a=summary.
您可以打开两个终端窗口并查看特定版本的文件。
假设你有回购轨道。
在第一个终端中输入:
在第二个终端中输入:
其中 v2.3.14 和 v3.2.0 是您感兴趣的特定版本的标签,“Rakefile”是您想要查看的文件。
You can open two terminal windows and view a file from specific revision.
Say, you have repo rails.
In first terminal you type:
And in the second:
Where v2.3.14 and v3.2.0 are tags for specific versions you are interested in, and the "Rakefile" is a file you want to see.