git: diff between file in local repo and origin

后端 未结 7 2147
我在风中等你
我在风中等你 2020-12-04 04:42

I want to find the differences between a file I have in my local repo vs what is in the origin master.

I know that there is git diff, howev

7条回答
  •  误落风尘
    2020-12-04 05:13

    Full answer to the original question that was talking about a possible different path on local and remote is below

    1. git fetch origin
    2. git diff master -- [local-path] origin/master -- [remote-path]

    Assuming the local path is docs/file1.txt and remote path is docs2/file1.txt, use git diff master -- docs/file1.txt origin/master -- docs2/file1.txt

    This is adapted from GitHub help page here and Code-Apprentice answer above

提交回复
热议问题