git diff between two different files

前端 未结 3 1953
悲哀的现实
悲哀的现实 2021-01-29 19:11

In HEAD (the latest commit), I have a file named foo. In my current working tree, I renamed it to bar, and also edited it.

I want

3条回答
  •  广开言路
    2021-01-29 19:55

    I believe using --no-index is what you're looking for:

    git diff [] --no-index [--]  
    

    as mentioned in the git manual:

    This form is to compare the given two paths on the filesystem. You can omit the --no-index option when running the command in a working tree controlled by Git and at least one of the paths points outside the working tree, or when running the command outside a working tree controlled by Git.

提交回复
热议问题