{"id":22249102,"url":"https://github.com/purplebooth/git-mit","last_synced_at":"2025-04-06T22:08:30.875Z","repository":{"id":37862019,"uuid":"257683584","full_name":"PurpleBooth/git-mit","owner":"PurpleBooth","description":"Minimalist set of hooks to aid pairing and link commits to issues","archived":false,"fork":false,"pushed_at":"2024-04-13T17:50:52.000Z","size":11281,"stargazers_count":60,"open_issues_count":4,"forks_count":3,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-04-14T07:12:22.065Z","etag":null,"topics":["git","hacktoberfest","jira","lint","pair-programming","pivotal-tracker"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"cc0-1.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PurpleBooth.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":".github/FUNDING.yml","license":"LICENSE.md","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null},"funding":{"github":["PurpleBooth"],"patreon":null,"open_collective":null,"ko_fi":"billie","tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":null}},"created_at":"2020-04-21T18:37:40.000Z","updated_at":"2024-08-12T10:00:33.672Z","dependencies_parsed_at":"2024-01-05T13:37:23.482Z","dependency_job_id":null,"html_url":"https://github.com/PurpleBooth/git-mit","commit_stats":{"total_commits":1818,"total_committers":12,"mean_commits":151.5,"dds":0.6171617161716172,"last_synced_commit":"078104d02455445ceee124485d90833f0cfd935d"},"previous_names":[],"tags_count":717,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PurpleBooth%2Fgit-mit","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PurpleBooth%2Fgit-mit/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PurpleBooth%2Fgit-mit/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PurpleBooth%2Fgit-mit/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PurpleBooth","download_url":"https://codeload.github.com/PurpleBooth/git-mit/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247557767,"owners_count":20958047,"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":["git","hacktoberfest","jira","lint","pair-programming","pivotal-tracker"],"created_at":"2024-12-03T06:22:03.246Z","updated_at":"2025-04-06T22:08:30.850Z","avatar_url":"https://github.com/PurpleBooth.png","language":"Rust","funding_links":["https://github.com/sponsors/PurpleBooth","https://ko-fi.com/billie"],"categories":[],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n    \u003cimg alt=\"git-mit\" width=\"50%\" src=\"./logo/logo.png\"\u003e\n\u003c/p\u003e\n\n*git-mit* is a suite of git hooks. It's aimed to make pair programming,\nadding issue numbers to your commits, and following good commit message\npractices something that happens without thinking about it.\n\n## Usage\n\n### Preparing the repository\n\nThis works via git hooks, so you need these hooks to be present in the\ngit repository you're using to use them.\n\n``` shell,script(name=\"1\",expected_exit_code=0)\ngit init .\ngit mit-install\n```\n\nThis works by creating a symlink in your repositories hooks directory.\nYou can do this automatically by adding them to your [init\ntemplate](https://git-scm.com/docs/git-init#_template_directory). This\nis the template that git uses to create the `.git` directory when you\nrun `git init`.\n\n``` shell,skip()\ngit mit-install --scope=global\n```\n\nYou can also run this on an existing repository, to set up an already\nchecked out repository. You can re-initialise all of your repositories,\nrecursively from the home directory using this command.\n\n``` shell,skip()\nfind \"$HOME\" -type d -name .git -exec sh -c 'git init \"$1\"/..' -- {} \\;\n```\n\n### Lint list\n\n``` shell,script(name=\"lint-list\",expected_exit_code=0)\ngit mit-config lint available\n```\n\n``` text,verify(script_name=\"lint-list\",stream=stdout)\n╭───────────────────────────────────┬──────────╮\n│ Lint                              ┆ Status   │\n╞═══════════════════════════════════╪══════════╡\n│ duplicated-trailers               ┆ enabled  │\n├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤\n│ pivotal-tracker-id-missing        ┆ disabled │\n├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤\n│ jira-issue-key-missing            ┆ disabled │\n├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤\n│ github-id-missing                 ┆ disabled │\n├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤\n│ subject-not-separated-from-body   ┆ enabled  │\n├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤\n│ subject-longer-than-72-characters ┆ enabled  │\n├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤\n│ subject-line-not-capitalized      ┆ disabled │\n├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤\n│ subject-line-ends-with-period     ┆ disabled │\n├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤\n│ body-wider-than-72-characters     ┆ enabled  │\n├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤\n│ not-conventional-commit           ┆ disabled │\n├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌╌┤\n│ not-emoji-log                     ┆ disabled │\n╰───────────────────────────────────┴──────────╯\n```\n\nWith only lints that ensure git will work properly enabled by default\n\n``` shell,script(name=\"lint-list\",expected_exit_code=0)\ngit mit-config lint enabled\n```\n\n``` text,verify(script_name=\"lint-list\",stream=stdout)\n╭───────────────────────────────────┬─────────╮\n│ Lint                              ┆ Status  │\n╞═══════════════════════════════════╪═════════╡\n│ duplicated-trailers               ┆ enabled │\n├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤\n│ subject-not-separated-from-body   ┆ enabled │\n├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤\n│ subject-longer-than-72-characters ┆ enabled │\n├╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌╌┼╌╌╌╌╌╌╌╌╌┤\n│ body-wider-than-72-characters     ┆ enabled │\n╰───────────────────────────────────┴─────────╯\n```\n\nYou can read more details about this, with examples on the [lints\npage](docs/lints/index.md)\n\n### Centralising lint config\n\nYou can add a `.git-mit.toml` or `.git-mit.toml.dist` to the root of\nyour repository, and we will read it and try to enable the correct lints\n(with `.git-mit.toml` taking precedence).\n\nI recommend you commit `.git-mit.toml.dist` and add `.git-mit.toml` to\nyour `.gitignore` to allow easy local reconfiguration\n\nFor example\n\n``` toml,file(path=\".git-mit.toml.dist\")\n[mit.lint]\n\"pivotal-tracker-id-missing\" = true\n```\n\nWith this you can enable lints\n\n``` shell,script(name=\"7\",expected_exit_code=0)\ngit mit-config lint status pivotal-tracker-id-missing\n```\n\n``` text,verify(script_name=\"7\",stream=stdout)\n╭────────────────────────────┬─────────╮\n│ Lint                       ┆ Status  │\n╞════════════════════════════╪═════════╡\n│ pivotal-tracker-id-missing ┆ enabled │\n╰────────────────────────────┴─────────╯\n```\n\nYou can read more about this on the [configuring\npage](docs/lints/configuring.md)\n\n### Append issue number\n\nIn projects, it is nice to help out your co-workers by linking the\ncommits you're making back to the issue in the backlog. This can get a\nbit tedious to remember though, so here's a command to reduce the amount\nof typing.\n\nSay you've just made this awesome `README.md` for Pivotal Tracker ID\n`[#12321513]`\n\n``` markdown,file(path=\"README.md\")\n# The Best Readme\n\nThis is the best readme\n```\n\nIf you run\n\n``` shell,script(name=\"2\",expected_exit_code=0)\ngit mit-relates-to \"[#12321513]\"\n```\n\nNext time you commit\n\n``` shell,script(name=\"3\",expected_exit_code=0)\ngit add README.md\ngit mit bt\ngit commit -m \"Wrote a great README\"\n```\n\nthe commit message will contain the ID\n\n``` shell,script(name=\"4\",expected_exit_code=0)\ngit show --pretty='format:author: [%an %ae] signed-by: [%GS] \n---\n%B' -q\n```\n\n``` text,verify(script_name=\"4\",stream=stdout)\nauthor: [Billie Thompson billie@example.com] signed-by: [] \n---\nWrote a great README\n\nRelates-to: [#12321513]\n```\n\nRead more about this at the [relates to page](docs/mit-relates-to.md)\n\n### Setting Authors and Co-Authors\n\nPairing is a great way to program, and it's even better when you give\ncredit, you can give credit with the mit command\n\nConfigure your authors like the example by creating a config at\n`$HOME/.config/git-mit/mit.toml`\n\n``` shell,script(name=\"3\")\ngit-mit-config mit example\n```\n\n``` toml,verify(script_name=\"3\",stream=stdout)\n[ae]\nname = \"Anyone Else\"\nemail = \"anyone@example.com\"\n\n[bt]\nname = \"Billie Thompson\"\nemail = \"billie@example.com\"\nsigningkey = \"0A46826A\"\n\n[se]\nname = \"Someone Else\"\nemail = \"someone@example.com\"\n```\n\nAnd you can run\n\n``` shell,script(name=\"6\",expected_exit_code=0)\ngit mit ae bt se\n```\n\nThen next when you make a commit the `Co-authored-by` trailers will be\nset of the author initials you selected.\n\n``` shell,script(name=\"7\",expected_exit_code=0)\necho \"# Hello, world!\" \u003e README.md\n\ngit add .\ngit commit --message=\"Initial Commit\" --quiet\ngit show --pretty='format:author: [%an %ae] signed-by: [%GS] \n---\n%B' -q\n```\n\n``` text,verify(script_name=\"7\",stream=stdout)\nauthor: [Anyone Else anyone@example.com] signed-by: [] \n---\nInitial Commit\n\nCo-authored-by: Billie Thompson \u003cbillie@example.com\u003e\nCo-authored-by: Someone Else \u003csomeone@example.com\u003e\nRelates-to: [#12321513]\n```\n\nNotice how the \"Relates-to\" tag is here even though we didn't trigger\nit? It's from the example higher on the page, git-mit remembers your\nauthor and ticket number for 60 min\n\nFor more information on this see the [mit page](docs/mit.md)\n\n## Installing\n\nYou can install this with brew! This is the preferred method of\ninstalling.\n\n``` shell,skip()\nbrew install PurpleBooth/repo/git-mit\n```\n\nYou can use Cargo too, though this won't install the completions\n\n``` shell,skip()\ncargo install git-mit\ncargo install git-mit-config\ncargo install git-mit-install\ncargo install git-mit-relates-to\ncargo install mit-commit-msg\ncargo install mit-pre-commit\ncargo install mit-prepare-commit-msg\n```\n\nYou can also download the [latest\nrelease](https://github.com/PurpleBooth/git-mit/releases/latest) and run\nit.\n\nThere is a script to download the latest release:\n\n* [Windows](./installer.ps1)\n* [Linux/Mac OS](./installer.sh)\n\n### Completions\n\nWe generate completions for `fish`,`zsh`, and `bash`. They're installed\nwith the homebrew package. You don't need to do anything to activate\nthem.\n\nEach binary also has a command to generate completion.\n\n## Docs\n\n### Common Tasks\n\n-   [Using the pair programming part of the tool](./docs/mit.md)\n-   [Using the issue number inserting part of the tool](./docs/mit-relates-to.md)\n-   [Configuring lints](./docs/lints/configuring.md)\n-   [Lint list](./docs/lints/index.md)\n\n### Usage\n\n- [git-mit](./docs/binaries/git-mit.md)\n- [git-mit-config](./docs/binaries/git-mit-config.md)\n- [git-mit-install](./docs/binaries/git-mit-install.md)\n- [git-mit-relates-to](./docs/binaries/git-mit-relates-to.md)\n- [Hook: mit-commit-msg](./docs/binaries/mit-commit-msg.md)\n- [Hook: mit-pre-commit](./docs/binaries/mit-pre-commit.md)\n- [Hook: mit-prepare-commit-msg](./docs/binaries/mit-prepare-commit-msg.md)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurplebooth%2Fgit-mit","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpurplebooth%2Fgit-mit","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpurplebooth%2Fgit-mit/lists"}