Project

git-story

0.0
No commit activity in last 3 years
No release in over 3 years
A Ruby script for git that finds what branch a commit came from.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 0
 Project Readme

Introduction¶ ↑

Have you ever found yourself wondering what branch a particular commit came from in git? Or how your master branch ended up containing that commit that really shouldn’t be there? That commit probably started its live on a separate branch before making its way to the master branch through a series of pull requests and merges. This merge history can be quite complex and there is no tool that just shows you the relevant merges. The git-story ruby script aims to remedy this.

Getting Started¶ ↑

First you’ll need to install the git-story gem, as this will download the other gems required to run this script:

gem install git-story

Next you’ll want to download the script file from the /lib folder and make it executable by running:

chmod u+x git-story

You can now run it by calling the script by its full path name. You could also put the script somewhere in your $PATH and run it by typing ‘git-story’.

Example¶ ↑

Finding all the ways that a given commit could have made it into a particular branch is as easy as running

git-story --commit <your commit sha here> --branch <your branch name here>

The output will be of the form

Possible path
-------------
<commit date>  <commit sha>  <commit message>  <author>  START
<commit date>  <commit sha>  <commit message>  <author>  MERGE
<commit date>  <commit sha>  <commit message>  <author>  MERGE
...
<commit date>  <commit sha>  <commit message>  <author>  HEAD