2009-11-08 11 views

Respuesta

117
:q 

que es un comando less, en realidad. Utiliza los mismos comandos que vi.

+3

Si es menor, entonces no se necesitan dos puntos (:). ¡Estás pensando si vi! –

+8

sí, solo 'q' funciona –

+0

ambos funcionan tan ..... – RageZ

357

Tengo que adivinar aquí, pero git probablemente está ejecutando su salida en su programa $ PAGER, probablemente less o more. En cualquier caso, escribiendo q debería sacarlo.

+8

El buscapersonas usado por git se selecciona mediante la variable de configuración 'core.pager' (si está configurada), luego la variable de entorno GIT \ _PAGER, luego la variable de entorno PAGER, luego' less' como reserva. –

+4

+1 Gracias por aliviar mi dolor, lol – Anthony

+1

Gracias de nuevo, la mayoría de las veces solía comenzar todo de nuevo. También soy un novato .. – 1088

85

Escriba 'q' y hará el trabajo.

Cuando se encuentre en la terminal y tenga una situación similar, tenga en cuenta también intentar escribir 'salir', 'salir' y la combinación de teclas de aborto 'Ctrl + C'.

+3

Estaba usando 'Ctrl + Z' y terminé con una tonelada de procesos de git sin terminar cuando ejecuté '' 'ps -ax'''. No sabía sobre '' 'q'''. – brokenindexfinger

+1

Ctrl + Z pone las tareas en segundo plano, por lo que tiene sentido. Personalmente no pude obtener Ctrl + C para cerrarlo. q funciona – Amalgovinus

+0

Ctrl + C funciona en esas instancias extrañas. – 3366784

4

primero de todo lo que es necesario alinear la configuración de preferencias que termina en termnial

git config --global core.autocrlf input 
git config --global core.safecrlf true 

continuación, puede utilizar :q

+0

Una nota para los usuarios de Windows: Para mí, agregar estas líneas resultó en la incapacidad de agregar archivos al seguimiento (fatal: CRLF sería reemplazado por LF en README.md). Entonces, si está usando Windows, agregue 'git config --global core.autocrlf true' en su lugar, hará el trabajo. – ConcurrentHashMap

2

Mi combinación preferida es Gq, que imprime todas las diferenciaciones y luego sale.

Puede escribir h para mostrar los comandos de ayuda para interactuar con menos, que imprime a esta consola:

    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> 
     --------------------------------------------------- 
7

para las ventanas:

Ctrl + Q y C para la salida de la situación de funcionamiento.

-2

exit lo hizo por mí. Mis resultados después de presionar regresar;

my-mac:Car Game mymac$ exit 
logout 
Saving session... 
...copying shared history... 
...saving history...truncating history files... 
    ...completed. 
[Process completed] 
+0

esto es lo mismo que cerrar toda la ventana, la pregunta pide salir de la sesión de git como en ssh –

1

Antes de presionar los comandos de salida (q, etc.) revise el idioma de entrada actual: si no es así, los comandos pueden no funcionar.

0

Si está en el juego git bash intente con exit;

Intenté usar la q o ctrl + q pero no funcionaron en bash.

Cuestiones relacionadas