Skip to content

Developer-style Bash prompt string formatting (PS1). Includes current branch name and counts for commit differences between branch and master and master and remote (where applicable) edit

License

Notifications You must be signed in to change notification settings

xtrementl/dev-bash-git-ps1

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

18 Commits
 
 
 
 
 
 

Repository files navigation

Developer's Bash-GIT PS1 Integration

Description

Provides simple information about git repository for the bash terminal

Erik Johnson (xtrementl)
Created: 07-29-2009
Updated: 03-31-2011

Special thanks to:
reborg

The PS1 will be formatted as follows:
Non-Git repo:
    [{host}: {dir}] -->
    $

Git repo:
    [{host}: {dir}] {branch}({diff upstream counts}){working dir syms} [{time last commit}] -->
    $

Notes

The marker ($) will be colored red/green depending on the result of last command's exit code
For Git repos, the working dir symbols are:
    + - staged changes
    * - unstaged changes
    ^ - stashed changes
    % - untracked files

Installation

Add the following line to your .bashrc:
    source ~/.bash_git_ps1.sh

About

Developer-style Bash prompt string formatting (PS1). Includes current branch name and counts for commit differences between branch and master and master and remote (where applicable) edit

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages