2012-08-01 46 views
2

我已創建並簽出分支test1。我做了一些改變和承諾。假設test1分支有三個提交。現在我正在創建名爲test2的分支(test1不會推送到中央服務器)並將test2推送到中央服務器。根據下面的鏈接,我得到了所有的三個提交。但是當我將test1推送到中央服務器時,沒有列出三個提交。Git:列出新分支推送期間的所有提交以及分支創建的起始地址

我想在test1分支推送操作期間列出的三個提交。我如何得到它?

How to get a list of incoming commits on git push for a new branch in a hook

回答

1

如果您對test1之上創建test2,您有效地推test2的推test1提交。 (第test1)不會推送任何新的提交。只有其中一個(已經推送)的test1指針提交。
這解釋了爲什麼your hook未列出新提交:沒有「$new_sha1」。

+0

感謝您的回覆。我明白這一點,但有沒有其他方式可以獲得test1提交列表? – Seenivasan 2012-08-01 07:32:16

+0

@Seenivasan是的,基於http://stackoverflow.com/questions/53569/how-to-get-the-changes-on-a-branch-in-git – VonC 2012-08-01 07:34:06

+0

我運行命令「$ git log ..test1 --no-merges --format ='%h |%s'--date = local「...它列出了test1分支以及之前的分支(master)提交。不完全是我期待的。 – Seenivasan 2012-08-01 11:01:55