Is there a way to see all changed files on a branch in Git?

前端 未结 4 705
自闭症患者
自闭症患者 2020-12-14 08:07

I apolagise if this isn\'t very clear but in Git, is there a way to see all changed files on a branch, by name only. As far as I know I can use git log to see files that ha

4条回答
  •  长情又很酷
    2020-12-14 08:36

    Supposing you're on branch foo, and you're interested in which files have changed since the point when it diverged from master, you can just do:

    git diff --name-only master...
    

    (Note the three dots.) If you're not foo, you can use the full form:

    git diff --name-only master...foo
    

    I made some graphics that explain the double-dot and triple-dot notations, and their differences between their meaning in git rev-list and git log - you can find them in this answer.

提交回复
热议问题