开发者

git diff two repositories, get results from .git dir?

开发者 https://www.devze.com 2023-04-08 18:42 出处:网络
I have two versions of a git repo on my computer, I wanted to know which is the differences between them, so I can know whether I should pull or not from the other repo.

I have two versions of a git repo on my computer, I wanted to know which is the differences between them, so I can know whether I should pull or not from the other repo.

I did a "git diff amslib ../workspace/amslib" and in开发者_StackOverflow中文版stead of showing me the differences between just the committed files in both repositories, it started to give me the differences in the .git directory too.

I suppose I'm not using the commands right, can anyone tell me how I should do it? I just want to know which version of the code has what changes, so I can either merge them, pull them, or manually copy them because I want some changes, but not others.

thanks


You should be able to add one respository as a "remote" to the other, fetch the extra commits and then diff them against the current repo.


You could do an ordinary recursive diff and ignore any results from the .git directories. I suspect @Noufal's solution is cleaner, but this is an alternative.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号