Skip to content

Instantly share code, notes, and snippets.

@jaredbeck
Created May 11, 2018 14:53
Show Gist options
  • Select an option

  • Save jaredbeck/4c51857226c58922d2001beac984da7d to your computer and use it in GitHub Desktop.

Select an option

Save jaredbeck/4c51857226c58922d2001beac984da7d to your computer and use it in GitHub Desktop.

Revisions

  1. jaredbeck created this gist May 11, 2018.
    28 changes: 28 additions & 0 deletions bash_git_cheatsheet.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,28 @@

    ## Prompt Structure

    By default, the general appearance of the prompt is::

    (<branch> <upstream branch> <branch tracking>|<local status>)

    The symbols are as follows:

    - Local Status Symbols
    - ````: repository clean
    - ``●n``: there are ``n`` staged files
    - ``✖n``: there are ``n`` files with merge conflicts
    - ``✖-n``: there are ``n`` staged files waiting for removal
    - ``✚n``: there are ``n`` changed but *unstaged* files
    - ``…n``: there are ``n`` untracked files
    - ``⚑n``: there are ``n`` stash entries
    - Upstream branch
    - Shows the remote tracking branch
    - Disabled by default
    - Enable by setting GIT_PROMPT_SHOW_UPSTREAM=1
    - Branch Tracking Symbols
    - ``↑n``: ahead of remote by ``n`` commits
    - ``↓n``: behind remote by ``n`` commits
    - ``↓m↑n``: branches diverged, other by ``m`` commits, yours by ``n`` commits
    - ``L``: local branch, not remotely tracked
    - Branch Symbol:<br />
    When the branch name starts with a colon ``:``, it means it's actually a hash, not a branch (although it should be pretty clear, unless you name your branches like hashes :-)