Go to file
2015-01-05 12:07:25 -05:00
base.sh Don't print newline if not in a git repository 2015-01-05 12:07:25 -05:00
LICENSE.txt fix #17, oh-my-git is licensed under MIT License 2013-11-14 10:06:32 +01:00
prompt.sh fix #25 - oh-my-git can be disabled on a per-repository basis (idea by Olaf Alders) 2014-05-28 09:05:54 +02:00
README.md @andreberg referenced with his name, and linked to his github page 2014-10-16 05:09:54 -04:00

oh-my-git!

![alt tag](https://raw.github.com/arialdomartini/oh-my-git-gh-pages/gh-pages/images/samples/01-not in a git repo.jpg) ![alt tag](https://raw.github.com/arialdomartini/oh-my-git-gh-pages/gh-pages/images/samples/02-in a git repo.jpg) ![alt tag](https://raw.github.com/arialdomartini/oh-my-git-gh-pages/gh-pages/images/samples/03-on master.jpg) alt tag alt tag ![alt tag](https://raw.github.com/arialdomartini/oh-my-git-gh-pages/gh-pages/images/samples/06-a typical session.jpg) ![alt tag](https://raw.github.com/arialdomartini/oh-my-git-gh-pages/gh-pages/images/samples/07-tracking branch.jpg) ![alt tag](https://raw.github.com/arialdomartini/oh-my-git-gh-pages/gh-pages/images/samples/08-explicit upstream.jpg) alt tag alt tag alt tag alt tag alt tag

alt tag

Bash

Installation

One liner for Mac:

cd ~ && git clone https://github.com/arialdomartini/oh-my-git.git && echo source $HOME/oh-my-git/prompt.sh >> .profile

One liner for Ubuntu:

cd ~ && git clone https://github.com/arialdomartini/oh-my-git.git && echo source $HOME/oh-my-git/prompt.sh >> .bashrc

Then, set your Terminal font to Monospace (or edit oh-my-git and change the symbols used)

Manual installation

Fork the repo and git clone it in your home directory.

Then add

source $HOME/oh-my-git/prompt.sh

to the bash startup file (~/.profile on Mac, ~/.bashrc on Linux)

If you prefer to keep oh-my-git repository in a different directory, just modify the startup file accordingly to the chosen position

source /wherever-you-want/oh-my-git/prompt.sh

zsh

Installation

With antigen installed, just add

antigen-bundle arialdomartini/oh-my-git
antigen theme arialdomartini/oh-my-git-themes arialdo-granzestyle

to your .zshrc file.

oh-my-git-themes includes two themes: arialdo-granzestyle which is inspired to the great Granze theme, and arialdo-pathinline.

How to install antigen

antigen is a plugin manager for zsh. Installing antigen is straightforward:

cd ~ && git clone https://github.com/zsh-users/antigen.git .antigen 

Then, edit your .zshrc file including

source "$HOME/.antigen/antigen.zsh"

antigen-bundle arialdomartini/oh-my-git
antigen theme arialdomartini/oh-my-git-themes arialdo-granzestyle

antigen-apply

I also strongly suggest to include

antigen-use oh-my-zsh
antigen-bundle git
antigen-bundle zsh-users/zsh-syntax-highlighting
antigen-bundle zsh-users/zsh-history-substring-search

which are optional, but very cool.

Then, restart zsh. antigen will download and install all that's needed.

Disabling oh-my-git

oh-my-git can be disabled on a per-repository basis. Just add a

[oh-my-git]
enabled = false

in the .git/config file of a repo to revert to the original prompt for that particular repo. This could be handy when working with very huge repository, when the git commands invoked by oh-my-git can slow down the prompt.

Known bugs and limitations

  • git v1.8.4 or newer is required
  • It works weird on brand new repositories, before the first commit
  • It has been tested on Mac and Ubuntu only. I never managed to make it work on Cygwin
  • You need an unicode font (like Menlo or Monaco on Mac OS X, or Monospace on Ubuntu; on Windows, with Cygwin, a good choice is Meslo by André Berg)
  • With the default Ubuntu terminal font, some symbols are not properly displayed. Use Monospace, or edit the prompt.sh file and choose other symbols