An interactive shell for git
Ruby C M4 Other
Clone or download
Permalink
Failed to load latest commit information.
arch Arch package for version 0.12 May 25, 2017
assets Update logo with new design Mar 24, 2017
bin DSL to define tab completion automaton state graph Jul 3, 2017
etc Configure completions for common commands. Aug 11, 2017
ext/gitsh Don't always close quotes when tab completing. Aug 26, 2016
homebrew Support explicit architectures for Readline. Apr 8, 2017
lib/gitsh Implement %g and %g git command prompt strings Dec 20, 2017
m4 Detect Ruby version in configure script Nov 21, 2013
man Implement %g and %g git command prompt strings Dec 20, 2017
spec Implement %g and %g git command prompt strings Dec 20, 2017
src DSL to define tab completion automaton state graph Jul 3, 2017
vendor Use a non-recursive Makefile. Dec 22, 2016
.gitignore DSL to define tab completion automaton state graph Jul 3, 2017
.hound.yml Enable hound Jun 28, 2017
.rubocop.yml Update hound config. Jul 3, 2017
.travis.yml Update CI Ruby versions. Apr 3, 2017
CODE_OF_CONDUCT.md Add CODE_OF_CONDUCT.md Jun 15, 2017
CONTRIBUTING.md Update release instructions. Jan 6, 2017
Gemfile Replace Parslet PEG with RLTK CFG. Apr 19, 2017
Gemfile.lock Replace Parslet PEG with RLTK CFG. Apr 19, 2017
INSTALL Bump version: 0.12 May 25, 2017
INSTALL.in Support explicit architectures for Readline. Apr 8, 2017
LICENSE Update copyright year to 2014. Jan 31, 2014
Makefile.am DSL to define tab completion automaton state graph Jul 3, 2017
README.md Remove extra spaces in Markdown-rendered code May 11, 2018
autogen.sh Add autogen.sh Nov 21, 2013
configure.ac DSL to define tab completion automaton state graph Jul 3, 2017

README.md

gitsh

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.

For a quick introduction to gitsh, watch our video on Upcase.

Build Status Code Climate

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 (change this command by setting gitsh.defaultCommand via git config; remember it will be prefixed with git), 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 affect git commands issued 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.

  • It works with hub and gh:

    sh$ gitsh --git $(which gh)
    gitsh% pull-request
    

Installing 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.

Similar projects

  • git-sh - A customised bash shell with a Git prompt, aliases, and completion.
  • gitsh - A simple Git shell written in Perl.
  • repl - Wraps any program with subcommands in a REPL.

License

gitsh is Copyright © 2016 Mike Burns, George Brocklehurst, and thoughtbot. It is free software, and may be redistributed under the terms specified in the LICENSE file.

About thoughtbot

thoughtbot

Created, maintained and funded by thoughtbot. The names and logos for thoughtbot are trademarks of thoughtbot, inc.

We love open source software! See our other projects. We are available for hire.