The gitsh
program is an interactive shell for git. From within gitsh
you can
issue any git command, even using your local aliases and configuration.
Why should you use gitsh?
-
Git commands tend to come in groups. Avoid typing
git
over and over and over by running them in a dedicated git shell:sh$ gitsh
gitsh% status
gitsh% add .
gitsh% commit -m "Ship it!"
gitsh% push
gitsh% ctrl-d
sh$
-
Hit return with no command to run
git status
, saving even more typing:gitsh% ⏎ # On branch master nothing to commit, working directory clean gitsh%
-
Easily execute shell commands:
gitsh% !echo Hello world Hello world gitsh%
-
Combine commands with
&&
,||
, and;
:gitsh% commit && push
-
Make temporary modifications to your git configuration with gitsh config variables. These changes only effect git commands issues in this gitsh session and are forgotten when you exit, just like shell environment variables.
gitsh% :set user.name 'George Brocklehurst and Mike Burns' gitsh% :set user.email support+george+mike@thoughtbot.com gitsh% commit -m 'We are pair programming'
-
Access information about your repository with magic variables like
$_rebase_base
,$_merge_base
and$_prior
.gitsh% rebase master CONFLICT (content): Merge conflict in db/schema.rb gitsh% checkout $_rebase_base -- db/schema gitsh% !rake db:schema:load db:migrate
-
Tab completion for git commands, aliases, and branches without modifying your shell settings, and without any extra setup for aliases and third party git commands.
-
Information about the state of your git repository in the prompt, without modifying your shell settings. This includes the name of the current HEAD, and a colour and sigil to indicate the status.
-
sh$ gitsh --git $(which gh) gitsh% pull-request
Installing gitsh
-
Mac OS X, via homebrew:
brew tap thoughtbot/formulae brew install gitsh
-
Arch Linux: https://github.com/thoughtbot/gitsh/blob/master/arch/PKGBUILD
-
OpenBSD -current:
sudo pkg_add gitsh
See the installation guide for install instructions for other operating systems.
Contributing to gitsh
Pull requests are very welcome. See the contributing guide for more details.
License
gitsh is Copyright © 2014 Mike Burns, George Brocklehurst, and thoughtbot. It is free software, and may be redistributed under the terms specified in the LICENSE file.