获取 git 中的提交范围
Get range of commits in git
我需要从特定范围内获得 git 提交,所以我一直在使用
git log old_commit..new_commit
当只添加了 1 个新提交时,它工作得很好,旧的和新的提交是 git commit -m ''
或 git pull
例如:
commit XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Merge: XXXXXXY XXXXXXZ
Author: name <name@domain.com>
Date: Fri Nov 20 11:45:33 2015 +0200
Merge branch 'master' of xxxxxx.xx:xxxxxxx
commit XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXY
Author: name <name@domain.com>
Date: Fri Nov 20 11:45:05 2015 +0200
some commit message here
(请注意,顺序可能不同 - 先合并然后提交)
我的观点是,当我这样做时:
git log XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXY..XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
它的行为出乎意料,而不是 1(最后一次)提交,它输出了更多其他的。
我是不是做错了什么?合并和提交被认为是一个还是什么?
我需要从特定范围内获得 git 提交,所以我一直在使用
git log old_commit..new_commit
当只添加了 1 个新提交时,它工作得很好,旧的和新的提交是 git commit -m ''
或 git pull
例如:
commit XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Merge: XXXXXXY XXXXXXZ
Author: name <name@domain.com>
Date: Fri Nov 20 11:45:33 2015 +0200
Merge branch 'master' of xxxxxx.xx:xxxxxxx
commit XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXY
Author: name <name@domain.com>
Date: Fri Nov 20 11:45:05 2015 +0200
some commit message here
(请注意,顺序可能不同 - 先合并然后提交)
我的观点是,当我这样做时:
git log XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXY..XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
它的行为出乎意料,而不是 1(最后一次)提交,它输出了更多其他的。
我是不是做错了什么?合并和提交被认为是一个还是什么?