GTM is automatic, seamless and lightweight. There is no need to remember to start and stop timers. It runs on occasion to capture activity triggered by your editor. The time metrics are stored locally with the git repository as Git notes and can be pushed to the remote repository.
Simply install a plugin for your favorite editor and the GTM command line utility to start tracking your time now.
Mac OS X
The simplest way to install is to use Homebrew
brew install --build-from-source \\
https://raw.githubusercontent.com/memcrab/gtm/master/Formula/gtm.rb
Revert to the previous version if you had it earlier.
brew uninstall gtm
brew untap git-time-metric/gtm
brew cleanup
Next, tap the repository once and install from there:
brew tap memcrab/gtm https://github.com/memcrab/gtm.git
brew install memcrab/gtm/gtm
Windows
- Download and run the Windows installer from here
Linux
The simplest way to install is to use Linuxbrew
brew install --build-from-source \\
https://raw.githubusercontent.com/memcrab/gtm/master/Formula/gtm.rb
Alternatively (after the first time):
brew tap memcrab/gtm https://github.com/memcrab/gtm.git
brew install memcrab/gtm/gtm
Manually install for Linux, OSX or Windows
- Download and install the executable from here
Building locally uses the Go toolchain with modules and a vendored libgit2 that is compiled automatically.
Prerequisites:
- Go 1.21 or newer in your PATH
cmake,pkg-config,git, and a C compiler (CLT/Xcode on macOS, build-essential on Linux)
Steps:
git clone https://github.com/memcrab/gtm.git
cd gtm
make build # produces bin/gtm, first run also builds libgit2
make test # optional, runs the unit test suite
The build caches dependencies under .gomodcache/ to avoid polluting your global Go module cache. To rebuild from scratch run make clean.
If you need to target a different libgit2 release, override the tag when invoking make:
LIBGIT2_TAG=v0.27.10 make build
The helper script will fetch and build the requested version before compiling GTM.
- Sublime 3
- Atom
- Vim
- IntelliJ IDEA, PyCharm, WebStorm, AppCode, RubyMine, PhpStorm, AndroidStudio
- VSCode
- Visual Studio
- Terminal
$ cd /my/project/dir
$ gtm init
Git Time Metric initialized for /my/project/dir
post-commit: gtm commit --yes
alias.fetchgtm: fetch origin refs/notes/gtm-data:refs/notes/gtm-data
alias.pushgtm: push origin refs/notes/gtm-data
notes.rewriteref: refs/notes/gtm-data
terminal: true
.gitignore: /.gtm/
tags: tag1, tag2
Check your progress with gtm status.
$ gtm status
20m 40s 53% [m] plugin/gtm.vim
18m 5s 46% [r] Terminal
15s 1% [m] .gitignore
39m 0s gtm-vim-plugin
When you are ready, commit your work like you usually do. GTM will automatically save the time spent associated with your commit. To check the time of the last commit type gtm report.
$ gtm report
7129f00 Remove post processing of status
Fri Sep 09 20:45:03 2016 -0500 gtm-vim-plugin Michael Schenk
20m 40s 53% [m] plugin/gtm.vim
18m 5s 46% [r] Terminal
15s 1% [m] .gitignore
39m 0s gtm-vim-plugin
GTM provides git aliases to make this easy. It defaults to origin for the remote repository.
Time data can be saved to the remote repository by pushing.
$ git pushgtm
Time data can be retrieved from the remote repository by fetching.
$ git fetchgtm
For help from the command line type gtm --help and gtm <subcommand> --help.
For additional help please consult the Wiki.
If you find a bug or have an idea for a new feature please feel free to file new issues and submits PRs. In particular if there isn't a plugin for your favorite editor, go ahead and create one!
For more detail on how to write plugins, check out the Wiki.
To report a bug, please submit an issue on the GitHub Page
Consult the Wiki for more information.
















