How to find out what files were changed in a git branch (not the difference between two branches)

…衆ロ難τιáo~ 提交于 2019-12-06 08:26:05

You could use git merge-base to find a common ancestor of two branches, then get the diff.

git diff --name-only feature_219 $(git merge-base master feature_219)

According to the git diff documentation

git diff --name-only master...feature_219

should do the trick. Notice the three dots. If you're currently on branch feature_219

git diff --name-only master...

suffices. The order of the two branches is very important. Interchanging the two branches in the first call will give you all changes in the master branch since you started the feature_219 branch.

The command git diff A...B should be interpreted as "give me all changes which happen in the commits when going from A to B". If A is not a parent of B (as in this case) the common ancestor will be used to answer this question.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!