Show diff between commits

前端 未结 11 2028
闹比i
闹比i 2020-12-02 04:00

I am using Git on Ubuntu 10.04 (Lucid Lynx).

I have made some commits to my master.

However, I want to get the difference between these commits. All of

11条回答
  •  天命终不由人
    2020-12-02 04:28

    To see the difference between two different commits (let's call them a and b), use

    git diff a..b
    
    • Note that the difference between a and b is opposite from b and a.

    To see the difference between your last commit and not yet committed changes, use

    git diff
    

    If you want to be able to come back to the difference later, you can save it in a file.

    git diff a..b > ../project.diff
    

提交回复
热议问题