stosb

wearer of programming socks

  • she/her

mid 20s | bisexual | programmer | european


profile pic: a picrew by Shirazu Yomi
picrew.me/en/image_maker/207297
i use arch btw
xenia the linux fox -> 🦊🏳️‍⚧️
the moon
🌙

dgelessus
@dgelessus

ORIG_HEAD points to whatever the previous HEAD was, before the last git pull (or other branch-modifying operation).

I find it particularly useful after pulling, because you can see the changes that you just pulled by running git log ORIG_HEAD..HEAD or git diff ORIG_HEAD..HEAD. No need to copy-paste the hashes from git pull's Updating abc7def..1337420 output - ORIG_HEAD..HEAD is always the right range of commits!

idk how well-known this is, but I only found out about it recently, despite using Git for years now. (Though I mostly use Git via GUIs, where it's a lot more obvious which commits are being added by a pull, so I had less of a need to look for a generic solution to this.)


knutaf
@knutaf

Absolutely incredible trick I didn't know


You must log in to comment.