When using Magit, the multitude of buffers can become a bit confusing when switching buffers. Therefore I prefer to have only one git-repository open in Magit. My current procedure of switching to another one requires to

  • find magit's status buffer
  • C-u C-u q to quit all of this git-repository's magit buffers
  • C-x g for the new git-repository.

I would like to reduce this to just C-x g to open the new repo's status buffer. Is there some build-in trick in Magit to do this? Alternatively: is there a hook I could use to close all magit buffers before magit-status?

  • Say explicitly what you mean by switching to another "project". How are you doing that? Depending on what you mean by that, there may well be a relevant hook you can use, etc.
    – Drew
    Commented Jan 17, 2022 at 17:32
  • Sorry, "project" == git-repository == directory -> editing question.
    – Harald
    Commented Mar 21, 2022 at 8:20


Your Answer

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

Browse other questions tagged or ask your own question.