我有一个develop
分支和一个master
分支。我想在一个从未克隆过任何存储库的盒子上得到两者之间的差异。所以我尝试了:
git diff --no-index remotes/origin/master remotes/origin/develop
它告诉我error: Could not access 'remotes/origin/master'
,这很公平,因为它不知道从中获得什么回购。
那么我如何告诉git存储库的位置,以便获取差异?
答案 0 :(得分:1)
那不是做到这一点的方法。试试这个:
git diff origin/master origin/develop
答案 1 :(得分:0)
您不需要使用remotes
。
遥控器是git存储分支文件的文件夹。
在git分支中,只是具有给定SHA-1的文件,这些文件存储在remotes文件夹内
为了比较分支,您不t need to use the
远程`
# Using the diff command
git diff origin/<branch_name> origin/<branch name>
# Using the log command
git log ^origin/<branch_name> origin/<branch name>
git log origin/<branch_name> ^origin/<branch name>