How do I "git checkout -f" from emacs-git?

In emacs-git mode for emacs, is there a way to do checkout -f

or an equivalent?

I just recently started using emacs-git. I liked this so far until I tried to switch to a different branch and received a message that "the raw working tree file will be overwritten" and the checkout was canceled.

Previously, when using git from the command line, I always did git checkout -f <branch>

to switch branches, but I can't seem to find the equivalent of a switch -f

in emacs-git.

Any ideas?

+2


source to share


3 answers


A command git checkout -f

is a much more dangerous command than not using a flag -f

, is this really what you want to do? You run the risk of accidentally dropping changes that have not yet been verified anywhere.



The error you received is related to a file that is not tracked on your current branch (but the file exists on disk), but is tracked on the branch you are changing to. Git wants to overwrite the unused file with the one that was checked out from the new branch. What if there was something important in this file? The error message indicates that you must first do something with this file before switching branches.

0


source


There are no multiple equivalent commands in these packages (I personally use magit). I would suggest either using the command line for these specific commands, or changing the package you are using.



0


source


Not exactly what you're looking for, but I've used it ESC-! command

in situations like this to quickly run a simple shell command in emacs.

0


source







All Articles