Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
595 views
in Technique[技术] by (71.8m points)

git - 显示两个修订版之间已更改的文件(Showing which files have changed between two revisions)

I want to merge two branches that have been separated for a while and wanted to know which files have been modified.

(我想合并两个已分开一段时间的分支,并想知道哪些文件已被修改。)

Came across this link: http://linux.yyz.us/git-howto.html which was quite useful.

(看到这个链接: http//linux.yyz.us/git-howto.html这非常有用。)

The tools to compare branches I've come across are:

(比较我遇到的分支的工具是:)

  • git diff master..branch
  • git log master..branch
  • git shortlog master..branch

Was wondering if there's something like "git status master..branch" to only see those files that are different between the two branches.

(想知道是否有类似“git status master..branch”的东西只能看到两个分支之间不同的文件。)

Without creating a new tool, I think this is the closest you can get to do that now (which of course will show repeats if a file was modified more than once):

(在没有创建新工具的情况下,我认为这是您现在可以做到的最接近的工具(如果文件被多次修改,当然会显示重复):)

  • git diff master..branch | grep "^diff"

Was wondering if there's something I missed...

(想知道是否有我遗漏的东西......)

  ask by johannix translate from so

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

Please log in or register to reply this article.

OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...