How to see code changes after git pull?

后端 未结 5 1262
孤城傲影
孤城傲影 2020-12-07 09:19

I would like to inspect any code changes after doing a git pull. Currently it\'s just showing me which files changes. How can I see what code changed?

5条回答
  •  刺人心
    刺人心 (楼主)
    2020-12-07 10:04

    You can compare the pulled contents with the sources of immediately previous commit by,

    git diff branch_name@{1}
    

    eg:

    git diff master@{1}
    

    For comparing with the sources n commits behind,

    git diff branch_name@{n}
    

提交回复
热议问题