childno͡.de
childno͡.de

Reputation: 4826

How to simplyfy getting the patch for one changeset in git?

git revision syntax is really powerful, but I can't find how to simplify things like:

git diff 1a2e^..1a2e

without writing tree'sh1 twice?

Is there now "NEXT" syntax, something like:

git diff 1a2e^..NEXT

OR

git changeset 1a2e

??

Another "next" syntax which might be useful if 1a2e is a known revision:

git cherry-pick 1a2e+NEXT..origin/featureBranch

^^ "cherry pick anything from 1a2e to master EXCEPT 1a2e itself"

Upvotes: 0

Views: 71

Answers (3)

childno͡.de
childno͡.de

Reputation: 4826

I've build a q'n'd workaround git-getnext which will get the child id in current branch from git log

Upvotes: 0

Adam Dymitruk
Adam Dymitruk

Reputation: 129654

you can do git log -1 -p sha1.

Upvotes: 0

Michael Krelin - hacker
Michael Krelin - hacker

Reputation: 143229

git show <tree-ish>

for instance.

And no, you can not refer to child commit, parent has no knowledge of it. And there may be more than one in no particular order.

Upvotes: 1

Related Questions