Skip to content

Instantly share code, notes, and snippets.

@sethkrasnianski
Last active January 30, 2017 04:02
Show Gist options
  • Save sethkrasnianski/5b9fccfc3afece87c776ac74d111df46 to your computer and use it in GitHub Desktop.
Save sethkrasnianski/5b9fccfc3afece87c776ac74d111df46 to your computer and use it in GitHub Desktop.
Magi(c)t

Because it’s practically magic.

Switching branches

SPC + g + s      - git status

    b                  - branch menu
        b              - select a branch

Creating branches

SPC + g + s      - git status

    b                  - branch menu
        c              - checkout

Committing

SPC + g + s      - git status

    s                  - stages line / file
    u                  - unstages line / file
    x                  - drops line / file
    c                  - commit menu
        c              - commit
                         Write commit message. C-c C-c or , , to create commit

    F                  - instant fixup lines / files into specific commit
                         C-c C-c on desired commit to complete

Interactive rebasing

SPC + g + s      - git status

    r                  - rebase menu
    i                  - interactive
    w                  - reword specific commit
    m                  - edit specific commit

Fetch / Rebase

SPC + g + s      - git status

    f                  - fetch menu
        a              - all remotes
        
    r                  - rebase menu
        e              - elsewhere
                         Type origin/master

Refreshing Magit

SPC + g + s      - git status

    g + r              - refreshes magic
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment