Переподключиться к случайно остановленному сеансу vi (git commit)

658
cp.engr

На Cygwin я случайно нажал Ctrl+Zпока в vim. Я редактировал git commitсообщение.

Это привело к

$ git commit -a  [1]+ Stopped git commit -a 

Я думаю, что сессия vi все еще активна:

$ ps -ef | grep vi myname 37252 15784 pty0 16:54:26 /usr/bin/vi 

Как я могу подключиться к viсеансу и возобновить работу?

0
введите `fg`, чтобы возобновить выполнение Daniel F 7 лет назад 1
Сообщение «[1] + Остановлено» означает, что вы нажали Ctrl + Z. Scott 7 лет назад 1
@ Скотт, спасибо, вопрос отредактирован. cp.engr 7 лет назад 0

1 ответ на вопрос

0
cp.engr

Вот что я сделал. Если есть более простой способ, не стесняйтесь опубликовать другой ответ.

$ git commit fatal: Unable to create '/cygdrive/c/projectDir/.git/index.lock': File exists.  Another git process seems to be running in this repository, e.g. an editor opened by 'git commit'. Please make sure all processes are terminated then try again. If it still fails, a git process may have crashed in this repository earlier: remove the file manually to continue.   $ rm /cygdrive/c/Clients/Gulden/dev/Watch_Firmware/.git/index.lock  $ git commit  E325: ATTENTION Found a swap file by the name "/cygdrive/c/projectDir/.git/.COMMIT_EDITMSG.swp" owned by: ... file name: /cygdrive/c/projectDir/.git/COMMIT_EDITMSG modified: YES user name: ... process ID: 37252 (still running) While opening file "/cygdrive/c/projectDir/.git/COMMIT_EDITMSG" dated: Wed Feb 1 17:11:22 2017 NEWER than swap file!  (1) Another program may be editing the same file. If this is the case, be careful not to end up with two different instances of the same file when making changes. Quit, or continue with caution. (2) An edit session for this file crashed. If this is the case, use ":recover" or "vim -r /cygdrive/c/projectDir/.git/COMMIT_EDITMSG" to recover the changes (see ":help recovery"). If you did this already, delete the swap file "/cygdrive/c/projectDir/.git/.COMMIT_EDITMSG.swp" to avoid this message. "/cygdrive/c/projectDir/.git/COMMIT_EDITMSG" 16 lines, 547 characters Press ENTER or type command to continue 

Делать :recoverв vim. Заполните и сохраните сообщение. Затем удалите старое кэшированное частичное сообщение:

 $ rm /cygdrive/c/projectDir/.git/.COMMIT_EDITMSG.swp