Following the git rev-parse
command, you can combine two of those in order to get the parent of a commit whose message match the regexp.
In a git bash, type:
git rev-parse $(git rev-parse :/<text>)^
Those are two commands:
- first getting the commit with the right message:
git rev-parse :/<text>
- then getting its parent
git rev-parse $(...)^
The $()
will execute the first command git rev-parse
and give its result to the second command git rev-parse
.
That will get you the parent of the commit with a commit message matching <text>
.
This differ from using only one command with:
git rev-parse HEAD^{/<text>}^
Or in Windows CMD:
git rev-parse "@^{/<text>}^"
# or, more complex, as ^ is the windows escape sign:
git rev-parse ^@^^{/<text>}^^