如何使用git从提交或拉取请求中提取文件路径和更改?

问题描述 投票:0回答:1

我正在尝试从Github中的提交/拉取请求中获取变更的合并列表(文件路径和新的/已修改/已删除的变更)。

这是我想要的格式:

filepath/to/some/file.properties:thisIsAKey=This is the string for this key.

我能够使用:相对容易地获取文件路径:

git show --pretty="format:" --name-only commitID

我也尝试过这个,但是它包含很多噪音:

git log -p commitID

这是使用上面的内容,但我只需要进行b / +更改:

diff --git a/locales/ES/es/forms/dispute-options.properties b/locales/ES/es/forms/dispute-options.properties
index 490457e9e0..569921196a 100644
--- a/locales/ES/es/forms/dispute-options.properties
+++ b/locales/ES/es/forms/dispute-options.properties
@@ -60,4 +60,5 @@ fraudSeller.info=Para cancelar este pedido tendrá que comunicarse directamente
 fraudSeller.errorHeadingMessage = Lo sentimos, pero no puede reportar este tipo de problema para la transacción seleccionada.
 fraudSeller.backButtonText = Atrás

-modal.cancel=Cancel
\ No newline at end of file
+modal.cancel=Cancel
+disputeOptions.creditTransactionInfo=Si presenta un caso para esta compra, aún tendrá que continuar pagando cualquier saldo importe dejado en su plan de {data.pageStore.value.creditProductDescriptor} junto con la comisiones tardía (si corresponde).

我一直在阅读有关如何使用diff-filter的文档,但还没有看到与我需要的东西匹配的东西。

希望有人可以提供帮助。这是我第一次发贴,所以请客气。先感谢您!

git github git-log git-show
1个回答
0
投票

鉴于您正在谈论PR(可能意味着很多修订,而不仅仅是一个修订),我认为您必须尝试:

git diff --name-only base-branch...pr-branch

注意三点符号

这应该为您提供添加/删除/修改的文件的列表。

© www.soinside.com 2019 - 2024. All rights reserved.