要对比本次 push 到上次 push 的 diff,怎么能获取到上次 push 操作的 commit 呢
要对比本次 push 到上次 push 的 diff,怎么能获取到上次 push 操作的 commit 呢
1
az09py OP 问题有点错误,应该是:在本次 push 时,获取最近一次的 pull/push 的 commit
|
2
geelaw Jul 17, 2018 你或许想要比较 remote/branch_name 和 local_branch_name
|
3
Keller0 Jul 17, 2018 via Android
你可能需要看 commit 的 msg 或者 tag
|
4
malusama Jul 17, 2018
git log
|
5
Oneneuuu Jul 17, 2018 via Android
gitlog 外加文本过滤一下吧
|
6
rabbbit Jul 17, 2018
git reflog show origin/master
|
7
alvinbone88 Jul 17, 2018
git rev-parse HEAD
|
8
gnaggnoyil Jul 18, 2018
这难道不是个 A-B 问题吗……
`git diff HEAD~1 HEAD` |
9
gnaggnoyil Jul 18, 2018
s/A-B 问题 /X-Y 问题 /g
|
10
siteshen Jul 18, 2018 还是不太明白"最近一次的 pull/push 的 commit",不过下面的命令能得到远端分支的最后一个 commit
git fetch; git rev-parse origin/${BRANCH} |
12
az09py OP @gnaggnoyil 这个是这次 commit 和上次 commit 的吧
|
15
siteshen Jul 19, 2018
@az09py `$(BRANCH}` 替换为 `$(git rev-parse --abbrev-ref HEAD)` 就行。
另外 @gnaggnoyil 说的 X-Y 问题应该是这个: https://coolshell.cn/articles/10804.html 意思是也许直接问你要解决的(完整的)问题,比问一个你提出的解决方案的一部分更好。 |