如何获得git whatchanged以显示已更改的文件的组合列表?

时间:2010-05-11 18:26:26

标签: git

我运行了以下命令

git whatchanged 7c8358e.. --oneline

并获得以下输出。有没有办法生成一个组合的文件列表,这些文件在所有提交中都发生了变化?换句话说,我不希望文件在下面的列表中出现多次。谢谢!

4545ed7 refs #2911. error on 'caregivers_sorted_by_position' resolved in this update. it came up randomly in cucumber
:100644 100644 d750be7... 11a0bd0... M  app/controllers/reporting_controller.rb
:100644 100644 7334d4d... e43d9e6... M  app/models/user.rb
e9b2748 refs #2911. group dropdown filters the list to only the users that belong to the selected group
:100644 100644 fc81b9a... d750be7... M  app/controllers/reporting_controller.rb
:100644 100644 aaf2398... f19038e... M  app/models/group.rb
:100644 100644 3cc3635... 7a6b2b1... M  app/views/reporting/users.html.erb
48149c9 refs #2888 cherry pick 2888 from master into prod-temp
:100644 100644 3663ecc... f672b62... M  app/controllers/user_admin_controller.rb
:100644 100644 aaf2398... 056ea36... M  app/models/group.rb
:100644 100644 32363ef... bc9a1f2... M  app/models/role.rb
:100644 100644 91283fa... 7334d4d... M  app/models/user.rb
:100644 100644 d6393a0... bae1bd6... M  app/views/user_admin/roles.html.erb
994550d refs #2890. all requirements included. cucumber has 1 exception in bundle_job for count of data rows. everything else green
:100644 100644 145122d... 869a005... M  app/controllers/profiles_controller.rb
:100644 100644 f1bfa77... 2ed0850... M  app/views/alerts/message.html.erb
:100644 100644 e9f8a34... f358a74... M  app/views/call_list/_item.html.erb
:100644 000000 fda1297... 0000000... D  app/views/call_list/_load_caregivers.erb
:000000 100644 0000000... fda1297... A  app/views/call_list/_load_caregivers.html.erb
:100644 100644 168de9e... 43594f4... M  app/views/call_list/show.html.erb
:100644 100644 e178d7f... 0fe77e1... M  app/views/profiles/edit_caregiver_profile.html.erb
7396ff6 refs #2890. fixed --we're sorry-- error
:100644 100644 d55d46d... fc81b9a... M  app/controllers/reporting_controller.rb
7c8358e refs #2897 link on online store back to http://www.halomonitoring.com
:100644 100644 d6f94f4... 8bc9c52... M  app/views/orders/new.html.erb

1 个答案:

答案 0 :(得分:5)

确切的答案可能取决于你的最终目标,但这会是这样的吗?

git diff --raw 7c8358e HEAD    # specify HEAD in case of local modifications

或者如果您真正关心的是文件列表:

git diff --name-status 7c8358e HEAD

你不会以这种方式获得提交消息,就像你从那里做的那样。我不确定我能想到任何真正一致的方法来获取提交列表和文件更改而不列出重复项。当然,您可以单独获取提交消息:

git log --oneline 7c8358e..    # or --pretty=%s or whatever format you want