开发者

How to automatically playback commit detail from a specific commit backward?

What I want is:

given a start commit p,

do the following:

开发者_运维问答git show p

and if finished reading and then press ENTER,automatically show the previous commit.

Until I press ctrl-c to terminate .

Is there a tool to do this?


$ git log --format=%h $commit | while read hash; do git show $hash; echo -n Press enter to continue; read dummy; done


Not exactly what you want, but the following is quite straight forward since <commit>~n designates the nth ancestor from a commit:

$ git checkout p
read...
$ git checkout p~1
read...
$ git checkout p~2
etc.

A small scripting effort will lead to the behavior you describe, though.


Not quite what you're asking for, but there's a git command to play back the commit history of a given file: git playback

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜