github.com/developest/gtm-core@v1.0.4-0.20220111132249-cc80a3372c3f/README.md (about) 1 **Based on https://github.com/git-time-metric/gtm** 2 3 <p align="center"> 4 <img src="./readme/logo.svg" width="256" height="256" alt="logo"> 5 </p> 6 7 ### Seamless time tracking for all your Git projects 8 ![Release](https://github.com/DEVELOPEST/gtm-core/workflows/Release/badge.svg?branch=master) 9 ![Develop](https://github.com/DEVELOPEST/gtm-core/workflows/Develop/badge.svg?branch=develop) 10 11 ## Installation 12 13 ### macOS 14 15 The simplest way to install is to use [Homebrew](http://brew.sh) 16 17 ``` 18 brew tap developest/gtm 19 brew install gtm 20 ``` 21 22 ### Windows 23 24 Download and run the Windows installer (.msi file) from [here](https://github.com/DEVELOPEST/gtm-core/releases/latest) 25 26 ### Linux 27 28 The simplest way to install is to use [Linuxbrew](http://linuxbrew.sh/) 29 30 ``` 31 brew tap developest/gtm 32 brew install gtm 33 ``` 34 35 There also is a debian package available under the [latest release](https://github.com/DEVELOPEST/gtm-core/releases/latest) 36 37 ### Manual install 38 39 To install GTM manually on macOS, Windows or Linux, read the wiki: https://github.com/DEVELOPEST/gtm-core/wiki/Installation 40 41 ## GTM 42 43 ##### $ gtm report -last-month 44 <div><img src="https://cloud.githubusercontent.com/assets/630550/21582250/8a03f9dc-d015-11e6-8f77-548ef7314bf7.png"></div> 45 46 ##### $ gtm report -last-month -format summary 47 <div><img src="https://cloud.githubusercontent.com/assets/630550/21582252/8f85b738-d015-11e6-8c70-beed7e7b3254.png"></div> 48 49 ##### $ gtm report -last-month -format timeline-hours 50 <div><img src="https://cloud.githubusercontent.com/assets/630550/21582253/91f6226e-d015-11e6-897c-6042111e6a6a.png"></div> </br> 51 52 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](https://git-scm.com/docs/git-notes) and can be pushed to the remote repository. 53 54 ### Plugins 55 56 Simply install a plugin for your favorite editor and the GTM command line utility to start tracking your time now. 57 58 ### Initialize a project for time tracking 59 60 <pre>$ cd /my/project/dir 61 $ gtm init 62 63 Git Time Metric initialized for /my/project/dir 64 65 post-commit: gtm commit --yes 66 pre-push: git push origin refs/notes/gtm-data --no-verify 67 alias.fetchgtm: fetch origin refs/notes/gtm-data:refs/notes/gtm-data 68 alias.pushgtm: push origin refs/notes/gtm-data 69 notes.rewriteMode: concatenate 70 notes.rewriteRef: refs/notes/gtm-data 71 add fetch ref: +refs/notes/gtm-data:refs/notes/gtm-data 72 terminal: true 73 .gitignore: /.gtm/ 74 tags: tag1, tag2 75 </pre> 76 77 ### Edit some files in your project 78 79 Check your progress with `gtm status`. 80 81 <pre>$ gtm status 82 83 20m 40s 53% [m] plugin/gtm.vim 84 18m 5s 46% [r] Terminal 85 15s 1% [m] .gitignore 86 39m 0s <b>gtm-vim-plugin</b> </pre> 87 88 ### Commit your work 89 90 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`. 91 <pre>$ gtm report 92 93 7129f00 <b>Remove post processing of status</b> 94 Fri Sep 09 20:45:03 2016 -0500 <b>gtm-vim-plugin</b> Michael Schenk 95 96 20m 40s 53% [m] plugin/gtm.vim 97 18m 5s 46% [r] Terminal 98 15s 1% [m] .gitignore 99 39m 0s <b>gtm-vim-plugin</b> </pre> 100 101 ### Optionally save time in the remote Git repository 102 103 GTM provides [git aliases](https://git-scm.com/book/en/v2/Git-Basics-Git-Aliases) to make this easy. It defaults to origin for the remote repository. 104 105 Time data can be saved to the remote repository by pushing. 106 <pre>$ git pushgtm </pre> 107 108 Time data can be retrieved from the remote repository by fetching. 109 <pre>$ git fetchgtm </pre> 110 111 ### Getting Help 112 113 For help from the command line type `gtm --help` and `gtm <subcommand> --help`. 114 115 For additional help please consult the [Wiki](https://github.com/DEVELOPEST/gtm-core/wiki). 116 117 # Contributing 118 If you find a bug or have an idea for a new feature please feel free to file new issues and submits PRs. 119 See [CONTRIBUTING.md](./CONTRIBUTING.md) for more detailed information! 120 121 # Building from source 122 123 ### Install go 124 You can follow any go installation tutorial, one for Ubuntu for example: https://medium.com/golang-basics/installing-go-on-ubuntu-b443a8f0eb55 125 126 ### Install apt dependencies 127 ```bash 128 sudo apt-get install libgit2-dev libssh2-1-dev libssl-dev cmake 129 ``` 130 131 ### Clone gtm-core 132 ```bash 133 git clone https://github.com/DEVELOPEST/gtm-core.git 134 mv gtm-core $GOPATH/src/github.com/DEVELOPEST/ 135 cd $GOPATH/src/github.com/DEVELOPEST/gtm-core 136 git submodule update --init # Install vendor dependecies 137 ``` 138 139 ### Install dependencies 140 ```bash 141 go get -d github.com/Masterminds/sprig 142 go get -d github.com/libgit2/git2go 143 cd $GOPATH/src/github.com/libgit2/git2go 144 git submodule update --init # get libgit2 145 cd vendor/libgit2 146 mkdir build && cd build 147 cmake .. 148 make 149 sudo make install 150 cd ../../.. 151 make install-static 152 ``` 153 154 ### Build 155 ```bash 156 cd $GOPATH/src/github.com/DEVELOPEST/gtm-core 157 mkdir build 158 go build -o build/ ./... 159 ``` 160 161 ## Support 162 To report a bug, please submit an issue on the [GitHub Page](https://github.com/DEVELOPEST/gtm-core/issues) 163 164 Consult the [Wiki](https://github.com/DEVELOPEST/gtm-core/wiki) for more information.