When using git, I exited by pressing ctrl+z in the vim editing interface. How do I get back to the editing interface?
黄舟
黄舟 2017-05-02 09:47:20
0
6
1041

Using git on Windows, when running the git commit -a command, I entered the vim editing interface. At this time, I accidentally pressed ctrl z to exit the vim editing interface, returned to the command line, and displayed this information:

$ git commit -a
Vim: 读错误,退出中...
Vim: Finished.

If you run git commit -a again at this time, the following message will appear:

$ git commit -a //ctrl+z退出之后再次运行git commit -a
fatal: Unable to create 'C:/Users/dell/gittest/.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.

Try fg to go back, but it doesn’t work. The following message is displayed:

$ fg
bash: fg: current: no such job

What should I do?

黄舟
黄舟

人生最曼妙的风景,竟是内心的淡定与从容!

reply all(6)
伊谢尔伦

Answer on your mobile phone, next time just git commit -am "commit"

phpcn_u1582

Kill the process and commit again?

大家讲道理

Just move the index.lock prompted outside the folder and try again

世界只因有你
Vim: 读错误,退出中...
Vim: Finished.

Very strange. (But considering it’s Windows, I’m relieved.)

Your Ctrl-Z does not put Vim in the background like on UNIX systems, but causes Vim to exit with an error, so fg naturally does not work.

You can delete the lock file by following the prompts in the second code block.

Don’t press Ctrl-Z casually in the future. You only said "use git on windows". I don't know which version of git you are using (the official version of git is based on msys; Cygwin has its own git and Vim; msys2 also has one; of course WSL also has a set...). In addition, you may be mixing different versions of bash and Vim, such as using the Windows native version of Vim in a Cygwin environment.

漂亮男人

Just delete this file C:/Users/dell/gittest/.git/index.lock

PHPzhong

fg

...........................................

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template