Skip to content

Instantly share code, notes, and snippets.

@GeordieP
Created February 19, 2021 22:52
Show Gist options
  • Save GeordieP/0f738122e49749b4752cde763b91cc04 to your computer and use it in GitHub Desktop.
Save GeordieP/0f738122e49749b4752cde763b91cc04 to your computer and use it in GitHub Desktop.

git terminal

cli for opening a git client (or other dev tool) in a certain directory

use

  • enter g command at shell

  • see a list of project names and paths

    $> g

    ( git projects )
    (n) // search
    [>] sharechest core      //| /gp/dev/sharechest/core
    [ ] sharechest connector //| /gp/dev/sharechest/connector
    [ ] git terminal         //| /gp/dev/git-terminal
    [ ] musicdatabase        //| /gp/dev/musicdatabase

navigation

  • k,j to navigate the list

    • [[projects.git-terminal.options]] startup in normal/insert mode?

    $> g

    ( git projects )
    (n) // search
    [>] sharechest core      //| /gp/dev/sharechest/core
    [ ] sharechest connector //| /gp/dev/sharechest/connector
    [ ] git terminal         //| /gp/dev/git-terminal
    [ ] musicdatabase        //| /gp/dev/musicdatabase

    jjj

    ( git projects )
    (n) // search
    [ ] sharechest core      //| /gp/dev/sharechest/core
    [ ] sharechest connector //| /gp/dev/sharechest/connector
    [ ] git terminal         //| /gp/dev/git-terminal
    [>] musicdatabase        //| /gp/dev/musicdatabase

    choosing a project

  • press enter to run git client command in chosen project/directory

  • navigate up to search (or press i for insert mode?) to start typing, filtering the list

  • press enter to choose the top option

    $> g

    ( git projects )
    // n indicates normal mode
    (n) // search
    [>] sharechest core      //| /gp/dev/sharechest/core
    [ ] sharechest connector //| /gp/dev/sharechest/connector
    [ ] git terminal         //| /gp/dev/git-terminal
    [ ] musicdatabase        //| /gp/dev/musicdatabase

    k

    // i indicates insert mode
    ( git projects )
    (i) |
    [ ] sharechest core      //| /gp/dev/sharechest/core
    [ ] sharechest connector //| /gp/dev/sharechest/connector
    [ ] git terminal         //| /gp/dev/git-terminal
    [ ] musicdatabase        //| /gp/dev/musicdatabase

    sha

    ( git projects )
    (i) sha|
    [>] sharechest core      //| /gp/dev/sharechest/core
    [ ] sharechest connector //| /gp/dev/sharechest/connector

    enter (runs cmd in sharechest core)

switch to insert mode

  • press i any time in normal mode to enter insert mode

  • [[projects.git-terminal.tests]]

    $> g

    ( git projects )
    // n indicates normal mode
    (n) // search
    [>] sharechest core      //| /gp/dev/sharechest/core
    [ ] sharechest connector //| /gp/dev/sharechest/connector
    [ ] git terminal         //| /gp/dev/git-terminal
    [ ] musicdatabase        //| /gp/dev/musicdatabase

    i

    ( git projects )
    (i) |
    [>] sharechest core      //| /gp/dev/sharechest/core
    [ ] sharechest connector //| /gp/dev/sharechest/connector
    [ ] git terminal         //| /gp/dev/git-terminal
    [ ] musicdatabase        //| /gp/dev/musicdatabase

switch to normal mode

  • press i any time in insert mode to enter normal mode

  • [[projects.git-terminal.tests]]

    $ g
    

    $> g

    ( git projects )
    (n) // search
    [>] sharechest core      //| /gp/dev/sharechest/core
    [ ] sharechest connector //| /gp/dev/sharechest/connector
    [ ] git terminal         //| /gp/dev/git-terminal
    [ ] musicdatabase        //| /gp/dev/musicdatabase

    i

    ( git projects )
    (i) |
    [>] sharechest core      //| /gp/dev/sharechest/core
    [ ] sharechest connector //| /gp/dev/sharechest/connector
    [ ] git terminal         //| /gp/dev/git-terminal
    [ ] musicdatabase        //| /gp/dev/musicdatabase

    sha

    ( git projects )
    (i) sha|
    [>] sharechest core      //| /gp/dev/sharechest/core
    [ ] sharechest connector //| /gp/dev/sharechest/connector

    esc

    ( git projects )
    (n) sha
    [>] sharechest core      //| /gp/dev/sharechest/core
    [ ] sharechest connector //| /gp/dev/sharechest/connector

    j

    ( git projects )
    (n) sha
    [ ] sharechest core      //| /gp/dev/sharechest/core
    [>] sharechest connector //| /gp/dev/sharechest/connector
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment