diff current working copy of a file with another branch's committed copy

后端 未结 6 2097
醉话见心
醉话见心 2020-12-12 13:27

I have a repo with file foo in the master branch. I switched to bar branch and made some changes to foo. How can I now run a git diff

6条回答
  •  执笔经年
    2020-12-12 14:05

    To see local changes compare to your current branch

    git diff .
    

    To see local changed compare to any other existing branch

    git diff  .
    

    To see changes of a particular file

    git diff  -- 
    

    Make sure you run git fetch at the beginning.

提交回复
热议问题