[英]How to git diff remote branches and specify the repository at the same time?
我有一個develop
分支和一個master
分支。 我想在一個從未克隆過任何存儲庫的盒子上得到兩者之間的差異。 所以我嘗試了:
git diff --no-index remotes/origin/master remotes/origin/develop
它告訴我error: Could not access 'remotes/origin/master'
,這很公平,因為它不知道從中獲取什么回購。
那么如何告訴git存儲庫的位置,以便獲取差異?
那不是做到這一點的方法。 嘗試這個:
git diff origin/master origin/develop
您無需使用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>
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.