git-story

Various extensions to git, documented below.

Install git-story

curl -L http://bit.ly/1hHt20S | bash

The above command will install and inject an import of the git-story script to either .bash_profile, .bashrc or .zshrc (in that order). See install script for details.

Reload your shell to initialize git-story extensions.

Getting started

Branch model:

  1. Start developing a feature, and name it git feature <name>
  2. Save local changes and sync with remote git finish
  3. Create a pull request

The principle is that you develop each new feature in its own branch and when you're done you push it and create a pull request. See GitHub flow branch model. Note that git feature and git finish are flexible. They both take an optional argument target-branch, which the current/new branch will sync with.

Example

$ git feature branch-name   # Sets up clean workspace based on remote master.
$ git finish              # Commit changes, updates current and local branch.

Output example (video).

Documentation

Print command usage:

$ git <git-story-extension> --usage

Branching extensions

Convenience extensions

Log extensions

Project integration extensions

Statistics extensions

git-story interactions

Misc

Configuration

Configure git-story by creating a file ~/.gitstoryrc For project specific configurations create a file named .gitstoryrc at the project's git root.

See full example with comments in docs/gitstoryrc-example.

Available options and their default value:

GS_DEFAULT_REMOTE='origin'          # Default remote for git story
GS_GIT_STORY_BRANCH='master'        # Target branch for 'feature' & 'finish'
GS_LOCAL_MERGE=false                # Perform local merge on 'finish'
GS_PRINT_CHECKLIST=false            # Print checklist before 'finish'
GS_GRAPHIC_PROMPT=false             # Show all prompts (on OSX) in a GUI dialog
GS_PROMPT_ON_DONE=false             # Prompt user before 'finish'
GS_TEST_ON_DONE=true                # Run test command before 'finish'
GS_SIGN_RELEASE=true                # Sign tags created with 'tag-release'
GS_SIGN_COMMITS=true                # Sign each commit created with addcom, with GPG-key
GS_SIGN_COMMITS_STRING=true         # Sign each commit created with addcom, with --signoff
GS_CHECKLIST_MESSAGE='...'          # Checklist string for 'finish'
GS_PRE_COMMIT_HOOK=''               # A command that runs all tests
GS_PACKAGE=''                       # Shell command for 'package'
GS_DEPLOY=''                        # Shell command for 'deploy'
GS_TAG_RELEASE=''                   # Shell command for 'tag-release'
GS_INTSALL=''                       # Shell command for 'install'
GS_HAS_GITHUB=true                  # Project has GitHub.
GS_PROJECT_URL=''                   # Project URL
GS_TEST_ON_AUTO_MERGE=true          # Run tests command on auto merge
GS_PRODUCTION_BRANCH='heads/master' # Integration branch for production
GS_NEXT_VERSION_BRANCH=''           # Integration branch for next
GS_EDGE_BRANCH=''                   # Integration branch for edge
GS_GIT_STORY_EXT_BRANCH='master'    # Target branch for git-story extension

Notes

License

git-story is released under the MIT License.