6

I'm aware of C-x v ~ which allows you to see a different revision of the current file, but I would like to visit the file on another branch.

Is this possible with magit, VC or git-timemachine?

1
  • 1
    As you're using git, note that there is no practical difference between a branch name and any arbitrary git commit/revision of your repository. They are all 'refs' representing the repository at a particular point in time. Branches and Tags are simply human-friendly names which point to a ref. So you can use these things interchangeably in most situations.
    – phils
    Jul 12, 2018 at 13:12

1 Answer 1

12

So I was confused because the options to choose from for C-x v ~ only showed older revisions of the file on this particular branch, but you can in fact specify a branch and have that file shown.

Ie. if you want to visit the current file on master:

C-x v ~

Then just specify

master

As suggested by @KyleMeyer, the Magit command for this would be

magit-find-file-other-window
3
  • 1
    You can accept your own answer here to resolve the question.
    – glucas
    Jul 11, 2018 at 11:57
  • 4
    For reference, the analogous command in Magit is magit-find-file-other-window.
    – Kyle Meyer
    Jul 11, 2018 at 21:59
  • I can't upvote comments yet, but thanks for the input guys!
    – alecvn
    Jul 11, 2018 at 22:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

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