How to overcome going futher down in git Bash

回眸只為那壹抹淺笑 提交于 2019-12-13 05:03:03

问题


I just went to commit using git bash. Before type anything accidentally typed character ' and press Enter key.

Unfortunately, I can not exit the editor it keeps going further down when I typed something and press Enter. I tried Exit, Clear everything.

Anyone can help me please.

Thanks for reading.


回答1:


You can type Ctrl + C to kill the process. Follow this link to see how it works

Ctrl+C is a map to the kill command. When you press them, kill sends a SIGINT signal, that's interrupts the process.

You can also type another ' to "fix" your issue. Read this link to understand how quoting is treated in bash

Strong quoting

Strong quoting is very easy to explain:

Inside a single-quoted string nothing(!!!!) is interpreted, except the single-quote that closes the quoting.

echo 'Your PATH is: $PATH' That $PATH won't be expanded, it's interpreted as normal ordinary text, because it's surrounded by strong quotes. In practise that means, to produce a text like Here's my test… as a single-quoted string, you have to leave and re-enter the single-quoting to get the character "'" as literal text: # WRONG echo 'Here's my test...'

RIGHT echo 'Here'\''s my test...'

ALTERNATIVE: It's also possible to mix-and-match quotes for readability: echo "Here's my test"



来源:https://stackoverflow.com/questions/31444876/how-to-overcome-going-futher-down-in-git-bash

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!