Click here to Skip to main content
15,879,535 members
Articles / DevOps / Git
Tip/Trick

Git History Tool

Rate me:
Please Sign up or sign in to vote.
5.00/5 (2 votes)
15 May 2015CPOL1 min read 19.1K  
Git History Tool

Introduction

This is a small tool getting history for a path in a given local git repository and exporting it using RazorTemplates.

The tool gets all the changes between revisions or to a revision of a local git repository and passes the commits to a Razor template which then outputs the result in a given file. The commits can be filtered by a given pat in the repository.

Usage

GitHistory.App.exe [-gitRepo] [-templateFile] [-outputFile] [-endRevision ] [-gitInstallationFolder ]
[-includeMerges] [-pageTitle ] [-pathInRepo ] [-startRevision ] 

To use the tool, you can pass the following arguments:

  • gitRepo(or just r) - The local path to the git repository
  • templateFile(or just t) - The path to the Razor template file that will be used for transforming the list of commits
  • outputFile(or just o) - The path to the file where the result content will be saved
  • startRevision(or r or revision) - This argument is optional and is needed if you want to get the changes in a range or to a revision
  • endRevision(or just er) - Optional argument that specifies the end revision
  • includeMerges(or just im) - Whether or not the merge commits to be included in the output
  • gitInstallationFolder(or just gi) - The path to the git executable if it is not set in the Path environment variable
  • pathInRepo(or just p) - The relative path inside the local repository where you want to get the changes for
  • pageTitle(or just pt) - This can be used for presentation purposes only. Can be passed to the command line and then output in the result

You can find the tool on github here. Example usage (example.bat) and razor (example.razor) files inside the project folder.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) Telerik
Bulgaria Bulgaria
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
-- There are no messages in this forum --