Often times, I work out of a single shell when I run git commands. For example, I will start a merge:

$ git merge origin/master

If during this merge there are conflicts, git will "block" the shell as I resolve conflicts one by one. However, sometimes I need to run more git commands in the repository to investigate why a conflict exists or to understand it better. But because git is blocked waiting on conflicts to be resolved, I cannot run more commands.

Normally I just launch another terminal for this, but this means I have to CD back to the directory and stuff, which is a little inconvenient. It would be nice if I could just use the screen command or something while git is blocked, to run commands and then switch back. However, my understanding is that I needed to run screen prior to starting the merge. I don't normally think to do this because I don't know in advance that I even need it.

Is there a way to switch away from the blocked shell and run some more commands? A shortcut key for starting a new screen perhaps (assuming screen is even the right tool for the job)?

I'm on Windows using Git 2.7, through the mintty terminal.


I tried CTRL-Z as suggested in comments but I get strange behavior:

$ git merge origin/master

$ fg
bash: fg: current: no such job

Note where it says "Stopped" is where I pressed CTRL+Z.

  • Try ctrl+z to background the process. I know that it works on a pure Linux system, I'm not so sure about Windows but it is worth a shot. Once it is backgrounded, do your stuff, then type 'fg' to continue resolving the merges. – Evan Jan 22 '16 at 15:57
  • @Evan I updated my question with the results of your recommendation. – void.pointer Jan 22 '16 at 17:25
  • Stopped is correct, usually fg will work to bring back the last process used. In this case, apparently not. Try "fg %git merge origin/master", so basically, fg %<command-name>, is the more verbose form of foregrounding a process, but it is more specific. – Evan Jan 22 '16 at 18:52

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.