查看(清单)在本地和远程分支之间更改的文件-git [英] See (list) files changed between local and remote branch - git
问题描述
如何列出当前本地分支和相应的远程分支之间的差异"文件?
How do I list files that are "diff"ed between my current local and the corresponding remote branch?
这种情况是,我早些时候就进行了远程控制,从那以后我就重新依赖master +压缩了一些提交.
The situation is that I had made a push to remote earlier and since then have rebased off master + squashed some commits.
在执行git status时,我得到
On doing a git status, I get
您的分支机构和来源/您的分支机构"已经分叉,分别为11和2 各自分别提交不同的内容.
Your branch and 'origin/YourBranch' have diverged, and have 11 and 2 different commits each, respectively.
我不想执行"git diff origin/YourBranch YourBranch
",因为所做的更改数量很大.确认在本地和远程之间更改的文件有意义之后,我将进行强制推送.
I do not want to do a "git diff origin/YourBranch YourBranch
" because the number of changes made is large. After confirming that the files which have changed between local and remote makes sense, I shall do a force push.
推荐答案
To list just file names, use the name-only
flag like this:
git diff --name-only origin/YourBranch YourBranch
name-only
将(来自 Git文档):
仅显示已更改文件的名称
Show only names of changed files
BTW, this can also be used for other commands, such as show
.
这篇关于查看(清单)在本地和远程分支之间更改的文件-git的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!