문제

I have two hashes and an URL of a git remote repository. How to perform a diff?

With SVN I do it this way:

svn diff -rXXX:YYY svn+ssh://host/path
도움이 되었습니까?

해결책

This is not possible without cloning the entire repository beforehand, due to the way git works. After cloning you can create the diff like this:

git diff <from>..<to> -- <filename>

<from> and <to> may be some “commitish”, so tags, branches and everything else that can be resolved to a commit will work as well.


If you want to save some traffic and know for sure that both commits are inside the last hundred commits you may use:

git clone --depth 100 <repository>

This will only clone the newest 100 commits. Please note that it will be impossible to push or pull from this clone afterwards!

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top