1

How does one ediff a current file--ie working tree--against an arbitrary version in some previous commit?

In this case, I'm interested in pulling in some, but not all, changes from a commit in another feature branch that was rejected.

2

I can't think of a one-step way to do this. The best I can come up with is

  • Type dr (magit-diff), and set the range to the commit

    If point is on the commit, you can copy it with C-w before calling dr.

  • In the diff buffer, go to the file you want and hit e (magit-ediff-dwim)

Though you might consider doing away with the ediff step. You can hit v to reverse a hunk at point in the working tree.

  • The twist is that the commit is in another branch; can you reverse from a commit not in the current one? – E Bro May 12 '17 at 14:26
  • Did you try? When you enter a commit for a range, the diff shows the changes between that commit and the working tree (with the working tree changes treated as new). – Kyle Meyer May 12 '17 at 18:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.