【发布时间】:2010-12-14 08:43:36
【问题描述】:
我是 Git 和终端的新手。如何退出由git status 命令生成的列表模式?
【问题讨论】:
标签: git command-line terminal
我是 Git 和终端的新手。如何退出由git status 命令生成的列表模式?
【问题讨论】:
标签: git command-line terminal
在 Linux 终端中
git diff 输入后
:q
您可以退出显示跨页面更改的屏幕。
从远程合并项目或从远程提取更新后
ctrl + x
【讨论】:
[试试这个,也看看图片]
我尝试了其他方法,但没有奏效。我只是把'cd ../' 它起作用了
代码:
zsh:找不到命令:Q
$(virtual) ➜ ML git:(master) 退出
zsh:找不到命令:退出
$(virtual) ➜ ML git:(master) quit()
功能>
$(虚拟) ➜ ML git:(master) cd ../
(虚拟)➜最终
【讨论】:
请在 git bash 中尝试此步骤,它可能对您有所帮助。
CTRL + C:qa!【讨论】:
q 或 SHIFT+q 可以解决问题。这将使您摆脱许多广泛的页面滚动会话,例如 git status、git show HEAD、git diff 等。这不会退出您的窗口或结束您的会话。
【讨论】:
您可以为无法识别--no-pager 标志的命令禁用寻呼机。
git config --global pager.<command> false
我禁用日志别名并设置要返回的特定数量。
git config --global pager.log false
【讨论】:
Crt + c 适用于 Windows!用户1852392
【讨论】:
如果你在 git bash 上尝试使用 exit;
我尝试使用 q 或 ctrl + q 但它们在 bash 上不起作用。
【讨论】:
在按下退出命令(q 等)之前,请检查当前输入语言:如果不是英语命令可能不起作用。
【讨论】:
exit 为我做了。
我按回车后的结果;
my-mac:Car Game mymac$ exit
logout
Saving session...
...copying shared history...
...saving history...truncating history files...
...completed.
[Process completed]
【讨论】:
对于窗户:
Ctrl+q 和 c 用于退出运行状态。
【讨论】:
我首选的组合是Gq,它会打印所有差异然后退出。
你可以输入h来显示与less交互的帮助命令,它会打印到控制台:
SUMMARY OF LESS COMMANDS
Commands marked with * may be preceded by a number, N.
Notes in parentheses indicate the behavior if N is given.
h H Display this help.
q :q Q :Q ZZ Exit.
---------------------------------------------------------------------------
MOVING
e ^E j ^N CR * Forward one line (or N lines).
y ^Y k ^K ^P * Backward one line (or N lines).
f ^F ^V SPACE * Forward one window (or N lines).
b ^B ESC-v * Backward one window (or N lines).
z * Forward one window (and set window to N).
w * Backward one window (and set window to N).
ESC-SPACE * Forward one window, but don't stop at end-of-file.
d ^D * Forward one half-window (and set half-window to N).
u ^U * Backward one half-window (and set half-window to N).
ESC-) RightArrow * Left one half screen width (or N positions).
ESC-( LeftArrow * Right one half screen width (or N positions).
F Forward forever; like "tail -f".
r ^R ^L Repaint screen.
R Repaint screen, discarding buffered input.
---------------------------------------------------
Default "window" is the screen height.
Default "half-window" is half of the screen height.
---------------------------------------------------------------------------
SEARCHING
/pattern * Search forward for (N-th) matching line.
?pattern * Search backward for (N-th) matching line.
n * Repeat previous search (for N-th occurrence).
N * Repeat previous search in reverse direction.
ESC-n * Repeat previous search, spanning files.
ESC-N * Repeat previous search, reverse dir. & spanning files.
ESC-u Undo (toggle) search highlighting.
---------------------------------------------------
Search patterns may be modified by one or more of:
^N or ! Search for NON-matching lines.
^E or * Search multiple files (pass thru END OF FILE).
^F or @ Start search at FIRST file (for /) or last file (for ?).
^K Highlight matches, but don't move (KEEP position).
^R Don't use REGULAR EXPRESSIONS.
---------------------------------------------------------------------------
JUMPING
g < ESC-< * Go to first line in file (or line N).
G > ESC-> * Go to last line in file (or line N).
p % * Go to beginning of file (or N percent into file).
t * Go to the (N-th) next tag.
T * Go to the (N-th) previous tag.
{ ( [ * Find close bracket } ) ].
} ) ] * Find open bracket { ( [.
ESC-^F <c1> <c2> * Find close bracket <c2>.
ESC-^B <c1> <c2> * Find open bracket <c1>
---------------------------------------------------
【讨论】:
首先你需要在终端设置行结束首选项
git config --global core.autocrlf input
git config --global core.safecrlf true
那么你可以使用:q
【讨论】:
git config --global core.autocrlf true,它会完成这项工作。
键入“q”,它会完成这项工作。
当您在终端并遇到类似的困境时,请记住尝试输入“退出”、“退出”以及中止组合键“Ctrl + C”。
【讨论】:
ps -ax 时,我正在使用“Ctrl + Z”并最终得到大量未终止的 git 进程。不知道q。
:q 能够替我脱身。
q、esc 和许多其他键,但直到我可以跨越CTRL + C 并且它让我摆脱了它!
我必须在这里猜测,但 git 可能正在将其输出运行到您的 $PAGER 程序中,可能是 less 或 more。在任何一种情况下,输入 q 都会让你退出。
【讨论】:
core.pager配置变量选择(如果已设置),然后是GIT_PAGER环境变量,然后是PAGER环境变量,然后是less作为后备。
q 也有助于退出git diff 命令生成的列表模式。竖起大拇指
git config --global core.pager "less -F -X" 让它按照我想要的方式运行 - 没有用于状态、分支等的寻呼机,而是像 git log 这样的寻呼机