实际上,您可以从reflog中提取这些信息。 它不是远程仓库的完整历史记录,而是远程仓库分支的副本的历史记录。 因此,您将无法看到其他人对远程仓库所做的更改。这不是很漂亮,但您可以编写脚本使它变得更容易。
例如:
$ git reflog show origin/master
ca4f119 refs/remotes/origin/master@{0}: pull --rebase: fast-forward
d303ece refs/remotes/origin/master@{1}: pull --rebase: fast-forward
ce28c26 refs/remotes/origin/master@{2}: pull --rebase: fast-forward
0f71883 refs/remotes/origin/master@{3}: pull --rebase: fast-forward
8c2f0dd refs/remotes/origin/master@{4}: pull --rebase: fast forward
2958d6c refs/remotes/origin/master@{5}: update by push
6e9558c refs/remotes/origin/master@{6}: pull --rebase: fast-forward
8854b35 refs/remotes/origin/master@{7}: pull --rebase: fast-forward
b96f25d refs/remotes/origin/master@{8}: pull --rebase: fast-forward
efb0ab8 refs/remotes/origin/master@{9}: pull --rebase: fast-forward
71c12ca refs/remotes/origin/master@{10}: pull --rebase: fast-forward
d860e59 refs/remotes/origin/master@{11}: update by push
6342dbb refs/remotes/origin/master@{12}: fetch: fast-forward
...
你可以在这里看到,我最近的推送将origin/master
从6e9558c
推进到2958d6c
。要查看提交记录,可以使用git log 6e9558c..2958d6c
。例如:
$ git log --abbrev-commit --pretty=oneline 6e9558c..2958d6c
2958d6c Commit Summary 4
5cbe548 Commit Summary 3
13d007c Commit Summary 2
4f19ac3 Commit Summary 1
如果您可以访问远程代码库的终端,您可以在那端执行类似的操作,以查看它收到的所有推送。