Giter Club home page Giter Club logo

gitprompt's Introduction

Quick Installation

cd ~ && git clone https://github.com/jlem/gitprompt.git

Feel free to move this anywhere, but remember to source both colors.sh and gitprompt.sh

Example Usage

Example usage in .bash_profile or .bashrc

source ~/gitprompt/colors.sh
source ~/gitprompt/gitprompt.sh

function makePrompt()
{
    PS1="\u \w `getGitPrompt` $ "
}

PROMPT_COMMAND=makePrompt

Configuration Options

VARIABLE DEFAULT VALUE
GIT_PROMPT_SHOW_STASH_COUNT true
GIT_PROMPT_SHOW_STAGING_COUNTS true
GIT_PROMPT_SHOW_UNTRACKED_COUNT true
GIT_PROMPT_SHOW_COMMIT_DELTA_COUNTS true
GIT_PROMPT_COLOR_STASH_COUNT $P_DARK_GRAY
GIT_PROMPT_COLOR_UNTRACKED_COUNT $P_ORANGE
GIT_PROMPT_COLOR_UNSTAGED $P_RED
GIT_PROMPT_COLOR_STAGED $P_BRIGHT_CYAN
GIT_PROMPT_COLOR_BRANCH_OUT_OF_SYNC $P_LIGHT_GREEN
GIT_PROMPT_COLOR_BRANCH_OK $P_GREEN
GIT_PROMPT_COLOR_COMMIT_DELTA_COUNTS $P_DARK_GRAY
GIT_PROMPT_BRANCH_STATUS_ICON_OUT_OF_SYNC ' *'
GIT_PROMPT_BRANCH_STATUS_ICON_CONFLICT ' ⚠︎ '
GIT_PROMPT_BRANCH_STATUS_ICON_OK ' ✔'

Example usage of configuration options

Simply export any of those options and their new values from your .bash_profile or .bashrc

export GIT_PROMPT_SHOW_UNTRACKED_COUNT=false
export GIT_PROMPT_COLOR_COMMIT_DELTA_COUNTS=$P_ORANGE
export GIT_PROMPT_BRANCH_STATUS_ICON_CONFLICT="!"

Colors can be any properly escaped prompt-safe color definition, but the provided colors.sh sourced at the top of your bash file offers a few named constants to use instead of the raw color codes.

gitprompt's People

Watchers

James Cloos avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.