{"id":26649034,"url":"https://github.com/trinhminhtriet/git-hours","last_synced_at":"2026-03-09T07:35:55.254Z","repository":{"id":283868670,"uuid":"953141400","full_name":"trinhminhtriet/git-hours","owner":"trinhminhtriet","description":"🕒 Calculate coding hours from Git history - analyze time spent on repositories by commit patterns.","archived":false,"fork":false,"pushed_at":"2025-04-07T12:37:59.000Z","size":15,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T13:25:44.786Z","etag":null,"topics":["cli","developer-tools","git-analytics","golang","productivity","project-analytics","time-estimation","time-tracking"],"latest_commit_sha":null,"homepage":"","language":"Go","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/trinhminhtriet.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-03-22T17:00:25.000Z","updated_at":"2025-04-07T12:38:02.000Z","dependencies_parsed_at":"2025-03-22T18:23:49.646Z","dependency_job_id":null,"html_url":"https://github.com/trinhminhtriet/git-hours","commit_stats":null,"previous_names":["trinhminhtriet/git-hours"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/trinhminhtriet/git-hours","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinhminhtriet%2Fgit-hours","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinhminhtriet%2Fgit-hours/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinhminhtriet%2Fgit-hours/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinhminhtriet%2Fgit-hours/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/trinhminhtriet","download_url":"https://codeload.github.com/trinhminhtriet/git-hours/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/trinhminhtriet%2Fgit-hours/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":264476368,"owners_count":23614500,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli","developer-tools","git-analytics","golang","productivity","project-analytics","time-estimation","time-tracking"],"created_at":"2025-03-25T00:47:44.437Z","updated_at":"2026-03-09T07:35:50.225Z","avatar_url":"https://github.com/trinhminhtriet.png","language":"Go","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-hours\n\nA Go implementation of a tool to estimate time spent on a git repository based on commit history.\n\n## 🚀 Installation\n\n```bash\ngo install github.com/trinhminhtriet/git-hours@latest\n```\n\n## 💡 Usage\n\n```bash\ngit-hours [options]\n```\n\n### Options\n\n- `-max-commit-diff`: Maximum difference in minutes between commits counted to one session (default: 120)\n- `-first-commit-add`: How many minutes first commit of session should add to total (default: 120)\n- `-since`: Analyze data since certain date [always|yesterday|today|lastweek|thisweek|yyyy-mm-dd] (default: always)\n- `-until`: Analyze data until certain date [always|yesterday|today|lastweek|thisweek|yyyy-mm-dd] (default: always)\n- `-merge-request`: Include merge requests into calculation (default: true)\n- `-path`: Git repository to analyze (default: \".\")\n- `-branch`: Analyze only data on the specified branch (default: all branches)\n\n### Examples\n\n1. Estimate hours of project:\n\n```bash\ngit-hours\n```\n\n2. Estimate hours in repository where developers commit more seldom (4h pause between commits):\n\n```bash\ngit-hours --max-commit-diff 240\n```\n\n3. Estimate hours in repository where developer works 5 hours before first commit in day:\n\n```bash\ngit-hours --first-commit-add 300\n```\n\n4. Estimate hours work in repository since yesterday:\n\n```bash\ngit-hours --since yesterday\n```\n\n5. Estimate hours work in repository since specific date:\n\n```bash\ngit-hours --since 2015-01-31\n```\n\n6. Estimate hours work in repository on the \"master\" branch:\n\n```bash\ngit-hours --branch master\n```\n\n## Output\n\nThe tool outputs JSON with the following structure:\n\n```json\n{\n  \"author@email.com\": {\n    \"name\": \"Author Name\",\n    \"hours\": 42,\n    \"commits\": 100\n  },\n  \"total\": {\n    \"hours\": 42,\n    \"commits\": 100\n  }\n}\n```\n\n## Notes\n\n- Cannot analyze shallow copies. Run `git fetch --unshallow` first if needed.\n- Time estimation is based on commit dates and configured time windows\n- Merge commits can be excluded from the calculation\n\n## 🤝 How to contribute\n\nWe welcome contributions!\n\n- Fork this repository;\n- Create a branch with your feature: `git checkout -b my-feature`;\n- Commit your changes: `git commit -m \"feat: my new feature\"`;\n- Push to your branch: `git push origin my-feature`.\n\nOnce your pull request has been merged, you can delete your branch.\n\n## 📝 License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinhminhtriet%2Fgit-hours","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftrinhminhtriet%2Fgit-hours","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftrinhminhtriet%2Fgit-hours/lists"}