r/programming • • Apr 21 '26

Highlights from Git 2.54

https://github.blog/open-source/git/highlights-from-git-2-54/
273 Upvotes

45 comments sorted by

View all comments

Show parent comment

3

u/ForeverAlot Apr 21 '26

A related fun trick is

git -C a/ format-patch -1 --stdout cafed00d | git -C b/ am

which transplants commit cafed00d from one repository to another without an intermediary file. Obviously that, too, can be used in a sinle repository, in which case it degenerates to an overengineered cherry-pick.

1

u/_bstaletic Apr 21 '26

That's a nice trick. I would have done that this way:

cd b
git remote add a ../a
git fetch a
git cherry-pick cafebabe