When I checkout an existing remote branch, the current buffer remains on the old branch. However if I open a new file, that new file is on the checked-out branch.
My current workflow is this:
- editing file
a.txt
- magit-checkout
feature
(a.txt
exists onfeature
) - close
a.txt
- open
a.txt
And the workflow I want to get is this:
- editing file
a.txt
- magit-checkout
feature
(a.txt
exists onfeature
) a.txt
is now the version fromfeature
Is there a way to make the current buffer file be checked out on the new branch?
p.s. I'm using Spacemacs, don't know if that matters here.
revert-buffer
toF5
, so instead of closing the buffer and opening another one, I just hit a single key to reload.magit-checkout
, which would identify buffers associated to the repo and runrevert-buffer
on all of them.Global-Auto-Revert
minor mode... and for some reason after usingrevert-buffer
I now see the behavior I originally wanted, without any extra action on my part. Maybe the auto reverting only happens if magit knows the file exists in both branches. It's mysterious, but I have a workaround now, so thanks.