CARVIEW |
Every repository with this icon (

Every repository with this icon (

Description: | A customized bash environment suitable for git work. |
Clone URL: |
git://github.com/rtomayko/git-sh.git
Give this clone URL to anyone.
git clone git://github.com/rtomayko/git-sh.git
|
name | age | message | |
---|---|---|---|
![]() |
.gitignore | Sat Oct 04 19:44:57 -0700 2008 | .gitignore for generated git-sh file [xaviershay] |
![]() |
COPYING | Sun Aug 03 01:11:30 -0700 2008 | Let's get this party started [rtomayko] |
![]() |
Makefile | Sat Oct 11 17:41:08 -0700 2008 | improve Makefile and move site-related stuff ou... [ap] |
![]() |
README.markdown | Fri Oct 17 12:35:55 -0700 2008 | document /etc/gitshrc support [rtomayko] |
![]() |
git-completion.bash | Wed Nov 26 15:23:56 -0800 2008 | complete fetch, pull, push when $0 != git (reap... [rtomayko] |
![]() |
git-sh-config.bash | Fri Oct 17 12:35:55 -0700 2008 | document /etc/gitshrc support [rtomayko] |
![]() |
git-sh.bash | Sat Nov 29 16:19:29 -0800 2008 | add top-level reflog alias [rtomayko] |
![]() |
gitshrc-example.bash | Sat Sep 20 22:54:36 -0700 2008 | gitalias command; update .gitshrc example file [rtomayko] |
![]() |
site/ | Sat Oct 11 17:41:08 -0700 2008 | improve Makefile and move site-related stuff ou... [ap] |
git-sh
A customized bash shell suitable for git work.
The git-sh
command starts an interactive bash shell tweaked for heavy git interaction:
* Makes all git command porcelains available as top-level command aliases. * Custom prompt with branch and current repository. * Shawn O. Pearce’s bash completion support built-in. * Customizable via /etc/gitshrc
and ~/.gitshrc
config files (add aliases, change prompt, etc.) * gitalias
command for defining shorthand git aliases with completion. * Respects ~/.bashrc
and ~/.inputrc
configuration.
Installation
I suppose we can assume you have git installed:
$ git clone git://github.com/rtomayko/git-sh.git
$ cd git-sh
$ make
$ sudo make install
The make install
command copies the git-sh
executable to /usr/local/bin
. Use the PREFIX
environment variable to specify a different location (or just copy and chmod the git-sh
file).
If you’d like to be able to run git sh
instead of git-sh
, use the following to add a command alias in ~/.gitconfig
:
$ git-sh --configure
$ git sh
The git-sh prompt supports ANSI color but is disabled by default. To enable, set the color.sh
config value to auto
:
$ git config color.sh auto
The default prompt uses the colors you have configured for color.branch.current
and color.diff.meta
. See colors in git for information on customizing.
Basic Usage
I typically change into a git working copy before starting the shell:
$ cd some-git-repo
$ git sh
master!some-git-repo>
The shell’s default prompt shows the current branch, a bang, and the relative path to the current working directory from the nearest git working copy.
Most git commands can be executed directly:
master!some-git-repo> checkout -b new-branch
new-branch!some-git-repo> log -p
new-branch!some-git-repo> rebase -i HEAD~10
IMPORTANT: rm
, mv
, and diff
are aliased to their git counterparts. Use the command
command (eg. command rm
) or qualify the command (e.g. /bin/rm
) to use system versions.
Customizing
The /etc/gitshrc
and ~/.gitshrc
files are sourced (in that order) immediately before the shell becomes interactive. An example gitshrc
file is include in the distribution as an example.
Note also that your ~/.bashrc
file is sourced into the shell before either /etc/gitshrc
or ~/.gitshrc
, so any base bash customizations not explicitly overridden by git-sh
should be available.
Help
The help
command shows git’s help output followed by a list of custom aliases from your ~/.gitshrc
file:
master!some-git-repo> help
License
Copyright (C) 2008 Ryan Tomayko
Copyright (C) 2008 Aristotle Pagaltzis
Copyright (C) 2006, 2007 Shawn O. Pearce
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.