Skip to content

Add Git state information to your terminal for directories that are Git enabled.

Notifications You must be signed in to change notification settings

zeg-io/git-aware-terminal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 

Repository files navigation

Deprication Warning

This project still works but is no longer being maintained. This would make us cry as well, except the reason we are depricating it is because we have the same functionality in a much easier to use container:

https://www.npmjs.com/package/git-aware-terminal

Git Aware Terminal

At Zetta we love Git. It's like adding a third dimension to your world when you've been living in two. However, as powerful as it is, it requires a great deal of effort to learn and be effective at, and even if you are already a git master it still takes extra seconds here and there to maintain your awareness of what status your project is in.

Enter the Git Aware Terminal.

Video demo:
Video demo

It is a little scripting combined with a little design to yeild a much more usable git experience.

Git aware prompt views  
Our non-git directory prompt looks like this. Git is not initialized for this directory:
Basic terminal
When we go into our git project directory:
Git terminal
An untracked file:
untracked file
A modified, unadded file:
File Delta
A file pending commit:
Pending commit
Post commit we are now one commit ahead of remote origin:
One ahead
A coworker just pushed a change, now after a fetch we se we're behind by one:
One behind
Just created a new local branch that doesn't exist on remote:New branch
A currently detached repo:
Pending commit

Installation

  1. cd ~/ (or wherever you'd like the directory to be created)

  2. git clone https://github.com/zeg-io/git-aware-terminal.git
    - OR -
    Download and save git-aware-terminal.bash to your ~/ directory or wherever you like.

  3. Edit your bash config. In OSX it is located here: ~/.bash_profile.
    Add the following to the top of your file and save it. Clearly you can change the path of the script to wherever you clone the repo to if you'd like.

    if [ -f ~/git-aware-terminal/git-aware-terminal.bash ]; then
        . ~/git-aware-terminal/git-aware-terminal.bash
    fi
    PROMPT_COMMAND="parse_git_branch"
    ...
    

    Ensure that you aren't already using PROMPT_COMMAND= and if you are, just add parse_git_branch; ... to it.

  4. Run . ~/.bash_profile to reload your terminal and enable the newly added code, or close your terminal and restart it.

About

Add Git state information to your terminal for directories that are Git enabled.

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages