在给定的存储库中,输出两个提交之间的差异
当我想查看给定的两个提交SHA之间的GIF差异的输出(例如123ab45和678cd90)时,我使用 git diff 123ab45 678cd90
,
但是当两个人坐在其他回购中时,我正在尝试弄清楚如何输出它们。是否有任何特定命令可以使用回购名称输入来完成工作?
谢谢
When I want to see the output of the gif difference between given two commits SHAs (let's say 123ab45 and 678cd90), I use thisgit diff 123ab45 678cd90
But when the two commits that sit in a different repo, I am trying to figure out how to output them. Is there any specific command that will do the work with the repo name input?
Thanks
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
GIT命令仅在一个存储库上运行。
如果您拥有的两个存储库是基于同一存储库的,例如。已经从相同的来源中提取,但要有不同的提交,然后您可以从一个存储库中创建一个克隆,将第二个存储库添加为遥控器并获取所有缺失的提交。您最终获得了一个存储库的副本,该存储库都从两个存储库中进行了更改。 git差异将起作用。
The git command only operates on a single repository.
If the two repositories that you have are based on the same repository, eg. have been pulled from the same origin, but have different commits, then you can create a clone from one repository, add the second one as a remote and fetch all missing commits. You end up with a copy of the repository that has changes from both repositories. git diff will then work.
您可以
git提取
任何存储库URL中的任何其他存储库。默认情况下,这不会留下永久性的踪迹,即它将下载对象,但不会改变分支或其他裁判(只要您没有获得'fetch'和``拉动''混合)。请注意,这是在不添加遥控器的情况下完成的。 (尽管您想要都有两个存储库的
分支无关的存储库将需要下载所有数据,但否则不会损害本地存储库。 (如果您在不创建遥控器的情况下获取URL,则所有获取的数据将在以后的某个时候获得垃圾收集,因为没有分支参考。)
You can
git fetch
any repository URL into any other repository. By default this will not leave permanent traces, i.e. it will download the objects but won't alter branches or other refs (as long as you don't get 'fetch' and 'pull' mixed up).Note that this is done without adding a remote. (Although if you wanted to have branches from both repositories, then you could add a remote for the other repo.)
This works best if the two repositories have related histories, but that's not a requirement – fetching an unrelated repo will need to download all its data but won't otherwise harm the local repository. (If you fetch a URL without creating a remote, then all fetched data will get garbage-collected sometime later, as no branches reference it.)