如何找出git分支中更改了哪些文件(不是两个分支之间的差异)
我有一个名为feature_219
的分支,它是在不久前从master
创建的.自转移以来,两个分支上都更改了许多文件.
I have a branch named feature_219
which was created from master
a little while ago. Since the diversion, there were a number of files changed on both the branches.
现在,我试图找出仅在feature_219
分支上工作时更改了哪些文件.
Now I am trying to figure out what files where changed while working on the feature_219
branch only.
经过研究后,我发现git diff --name-only master feature_219
可能有所帮助,但事实证明,该命令可以告知两个分支中所有不同的文件.我试图用此命令寻找一些选项,但对我没有任何帮助.
After doing some research I found out that git diff --name-only master feature_219
might help but it turned out that this commands tells about all files that are different in both the branches. I tried to look for some option with this command but nothing worked for me.
有什么办法只列出那些在feature_219
分支中更改过的文件?
Is there any way to list only those files that were changed in feature_219
branch?
您可以使用git merge-base
查找两个分支的共同祖先,然后求出差异.
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)