On the terminal, in a repository with unstaged changes, I can do:
~/projects/introduction-to-clojure$ git checkout -f 3.7
Branch '3.7' set up to track remote branch '3.7' from 'origin'.
Switched to a new branch '3.7'
The flag -f
makes the command be a forced checkout, ignoring the unstaged changes.
I wish to achieve the same in Magit. Thus, I do: magit-status
(C-x g
), then magit-branch
(b
), branch/revision
(b
), and, finally, I pick 3.7
.
However, it does not work and the following error message is provided:
error: Your local changes to the following files would be overwritten by checkout:
src/introduction_to_clojure/core.clj
Please commit your changes or stash them before you switch branches.
Is it possible to force checkout to a tag in Magit even with unstaged changes? How to do so?