克隆和原始远程存储库之间的git diff [英] git diff between cloned and original remote repository

查看:96
本文介绍了克隆和原始远程存储库之间的git diff的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我克隆了一个github仓库,并且没有在本地进行任何更改。


  1. 如何在我的本地存储库和原始github存储库之间找到差异?

  2. 如何在我的工作副本和原始github存储库之间找到差异?

  3. 如何找到我的本地存储库与另一个github存储库的相同项目?


解决方案

1)添加要比较的任何远程存储库:

  git remote添加foobar git://github.com/user/foobar.git 


  git fetch foobar 

Fetch不会更改您的工作副本。



3)将本地资料库中的任何分支与您添加的任何远程资产进行比较:

  git diff master foobar / master 


I have cloned a github repository and made no changes locally. Github repository moved forward with commits on the same branch.

  1. How do I find a diff between my local repository and the original github repository?
  2. How do I find a diff between my working copy and the original github repository?
  3. How do I find a diff between my local repository and another github repository of the same project?

解决方案

1) Add any remote repositories you want to compare:

git remote add foobar git://github.com/user/foobar.git

2) Update your local copy of a remote:

git fetch foobar

Fetch won't change your working copy.

3) Compare any branch from your local repository to any remote you've added:

git diff master foobar/master

这篇关于克隆和原始远程存储库之间的git diff的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆