A customized bash shell suitable for git work.
git-sh command starts an interactive bash shell tweaked for heavy git
git checkout master)
~/.gitconfigavailable at top-level.
~/.gitshrcconfig files; for creating aliases, changing the prompt, etc.
~/.bashrc) and readline (
This repository is no longer actively maintained by @rtomayko as of 2017-11-08. Issues and PRs documenting current issues have been intentionally left open for informational purposes.
Install the most recent available version under
$ git clone git://github.com/rtomayko/git-sh.git $ cd git-sh $ make $ sudo make install
Start a shell with
$ git-sh master!git-sh> help
PREFIX environment variable to specify a different install location.
For example, under
$ make install PREFIX=~
Typical usage is to change into a git working copy and then start the shell:
$ cd mygreatrepo $ git sh master!mygreatrepo> help
Core git commands and git command aliases defined in
~/.gitconfig can be
used as top-level commands:
master!mygreatrepo> checkout -b new new!mygreatrepo> log -p new!mygreatrepo> rebase -i HEAD~10
It's really just a normal bash shell, though, so all commands on
PATH and any
aliases defined in
~/.bashrc are also available:
new!mygreatrepo> ls -l new!mygreatrepo> vim somefile
diff are aliased to their git counterparts. To use system versions,
command rm) or qualify the command (e.g.
The default prompt shows the current branch, a bang (
!), and then the relative
path to the current working directory from the root of the work tree. If the
work tree includes modified files that have not yet been staged, a dirty status
*) is also displayed.
The git-sh prompt includes ANSI colors when the git
color.ui option is
enabled. To enable git-sh's prompt colors explicitly, set the
$ git config --global color.sh auto
Customize prompt colors by setting the
color.sh.dirty git config values:
$ git config --global color.sh.branch 'yellow reverse' $ git config --global color.sh.workdir 'blue bold' $ git config --global color.sh.dirty 'red' $ git config --global color.sh.dirty-stash 'red' $ git config --global color.sh.repo-state 'red'
See colors in git for information.
git-sh behavior can be configured by editing the user or system gitconfig
/etc/gitconfig) either by hand or using
[alias] section is used to create basic command aliases.
~/.gitshrc files are sourced (in that order)
immediately before the shell becomes interactive.
~/.bashrc file is sourced before either
Any bash customizations defined there and not explicitly overridden by
are also available.
This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License, version 2, as published by the Free Software Foundation.