threads / discuss / 50315

git stash changes ORIG_HEAD

Subject: git stash changes ORIG_HEAD

## tl;dr

One message between Jan 25, 2019 and Jan 25, 2019.

replies: 0people: 1as markdown or json

Norbert Kiesel· Jan 25, 2019, 00:22 UTC · lore
Hi,
I monitor a couple of Git repos by reviewing changes via:

% git pull % git log -p -w --no-merges ORIG_HEAD..

This works wonderfully for me. However, sometimes I have pending changes in my repo (because I did not yet committed them to a new branch). I thought I could simply use

% git pull --rebase --autostash % git log -p -w --no-merges ORIG_HEAD..

However, this does not work as intended because stashing moves ORIG_HEAD. Right now I use

% orig=$(git rev-parse HEAD) % git pull --rebase --autostash % git log -p -w --no-merges orig..

Is it really necessary that ORIG_HEAD is moved while stashing? This does defeat it's purpose because it's always identical to HEAD after the stash is applied. Or could we have an option to not do that? Or is there already another symbolic name I could use?

Best,
  Norbert

← back to recent threads