我如何远程获取两个 git hash 之间的更改列表
我有两个 git hash,我想获取它们之间所有更改的日志,但这发生在服务器上,我需要一种不制作本地副本的方法,否则会涉及一个非常复杂的过程。
当我使用 svn 来执行此操作时,只需使用 svn 命令行,我就可以使用用户名查询两个版本之间的差异,这是完美的。
svn --username="bla" --password="bla" log http://svnrepository -r100:102
git 存储库不能远程充当我的服务器,以便我可以远程执行此操作吗?
I have two git hash i would like to get the log of all changes between them but this is happening on server I need a way to not make a local copy or it would involve a pretty involved procedure.
It was perfect when I use to do it with svn just having svn command line i could query it with a username for difference between two builds.
svn --username="bla" --password="bla" log http://svnrepository -r100:102
Can't a git repository remotely act like a server to me so I can execute this remotely?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我认为这是不可能的。与本地执行相比,在远程版本上运行的 diff 会非常慢,而 git 会尝试在本地执行操作。您能做的最好的事情就是克隆存储库,然后在两个远程分支之间进行比较。
OTOH,您也许可以使用某种 git Web 界面来在线查看差异。
I don't think this is possible. A diff running on remote versions would be incredibly slow compared to doing it locally and git tries to do things locally. The best you can do is to clone the repository and then diff between the two remote branches.
OTOH, you might be able to use some kind of git web interface to see diffs online.
如果您的存储库确实如此巨大,以至于这比仅克隆存储库要好,我认为您可以使用使用
git archive
及其--remote
选项。您可以轻松地沿着这些线路更改此脚本以获取远程存储库参数。If your repository is really so huge that this would be a win over just cloning the repository, I think you can do this with a script that uses
git archive
with its--remote
option. You can easily alter this script along those lines to take a remote repository parameter.