Often, when doing refactoring work in branch "Y" using git
, I think to myself -- How was this done in branch "X"? My local repo's in no place for a checkin -- and stash
ing so that I can switch branches, inspect the file in the other branch and then switch back (trying not to forget to stash pop
) in the process seems way too hacky. Is there a way to get a handle on the file in another branch so that I can display it next to the version in my current branch?
My editor is emacs
if that makes any difference. The ideal solution would give me a separate emacs buffer for the file in branch "X" -- But I realize that might be asking too much. Even something as simple as a hypothetical git cat myfile otherbranch
would be helpful.