{"id":15959826,"url":"https://github.com/erbridge/git-pair","last_synced_at":"2025-03-17T22:30:21.136Z","repository":{"id":150672722,"uuid":"209813884","full_name":"erbridge/git-pair","owner":"erbridge","description":"Attribute commits properly when pair programming!","archived":false,"fork":false,"pushed_at":"2023-10-25T19:23:36.000Z","size":5,"stargazers_count":5,"open_issues_count":0,"forks_count":1,"subscribers_count":4,"default_branch":"main","last_synced_at":"2024-10-14T15:08:35.179Z","etag":null,"topics":["git","git-hooks","pair-programming"],"latest_commit_sha":null,"homepage":"","language":"Shell","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/erbridge.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":"2019-09-20T14:45:29.000Z","updated_at":"2023-10-25T19:23:41.000Z","dependencies_parsed_at":"2024-10-07T15:01:20.795Z","dependency_job_id":"2861acc1-4787-4411-bde4-e63c421015b9","html_url":"https://github.com/erbridge/git-pair","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erbridge%2Fgit-pair","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erbridge%2Fgit-pair/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erbridge%2Fgit-pair/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/erbridge%2Fgit-pair/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/erbridge","download_url":"https://codeload.github.com/erbridge/git-pair/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":221701658,"owners_count":16866216,"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","git-hooks","pair-programming"],"created_at":"2024-10-07T15:01:10.804Z","updated_at":"2024-10-27T15:57:34.792Z","avatar_url":"https://github.com/erbridge.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Git Pair\n\nEasily attribute commits when pair programming!\n\n## Installation\n\n1. Clone / copy this repository locally. Replace `\u003cGIT_PAIR_PATH\u003e` in the\n   subsequent commands with the repository's absolute path (run `pwd` in the\n   repository).\n2. Set Git up to use the [hooks provided by this project](/githooks) using\n   [`core.hooksPath`](https://git-scm.com/docs/githooks) (don't worry, they're\n   set up to still run local repository hooks):\n\n   ```bash\n   git config --global core.hooksPath '\u003cGIT_PAIR_PATH\u003e/githooks'\n   ```\n\n3. Create aliases:\n\n   ```bash\n   git config --global alias.pair '!\u003cGIT_PAIR_PATH\u003e/bin/git-pair'\n   git config --global alias.solo '!\u003cGIT_PAIR_PATH\u003e/bin/git-solo'\n   ```\n\n## Usage\n\nWhen you start pairing, run\n\n```bash\ngit pair $ALIAS\n```\n\nwhere `$ALIAS` is a memorable alias for the person you're pairing with (I\nrecommend using their GitHub username). You can provide as many aliases at once\nas you like in the case you're pairing with more than one person.\n\nIf this is the first time pairing with someone, you'll be prompted to enter\ntheir name and email address. Use the values they want the commits attributed\nto. If you're using GitHub, you can also use their\n[GitHub-provided `no-reply` email address](https://help.github.com/en/articles/creating-a-commit-with-multiple-authors#required-co-author-information)\nand still get proper attribution.\n\nThen write code and commit as normal. Your commit messages will have trailers\nlike these appended to them:\n\n```\nCo-authored-by: name \u003cname@example.com\u003e\nCo-authored-by: another-name \u003canother-name@example.com\u003e\"\n```\n\nMake sure you leave a blank line between your commit message and any trailers.\n\nWhen you're done pairing, run\n\n```bash\ngit solo\n```\n\nto clear your pairs.\n\n**Note: pairs are per-repository. If you're working across more than one\nrepository, you'll need to set up (and clear) your pairs in each one.**\n\n## How it works\n\n`git pair` creates a file, `$GIT_DIR/current-co-authors`, which stores the\ndetails of your co-authors.\n\nGit looks into `core.hooksPath` for hooks. The hooks included in this repository\nall look for, and run, any executable hooks local to the Git repository you're\nworking in, so any existing local hooks should continue to function as normal.\nThe `prepare-commit-msg` hook looks in `$GIT_DIR/current-co-authors`, and adds\nco-author trailers to the commit message as the last step (so it will run after\nany local hooks).\n\n`git-solo` then removes `$GIT_DIR/current-co-authors`, clearing any configured\nco-authors from future commits.\n\nThe first time you run `git-pair` for someone, it prompts you for their name and\nemail address, which it stores in `$HOME/.gitpairs`. If an alias already exists\nthere, `git-pair` will just use that data instead of prompting.\n\n## Possible improvements\n\n- Make pairs editable. Currently, you have to manually edit `$HOME/.gitpairs`.\n- Make amending a commit authored by someone else add the current Git user as a\n  co-author.\n- Create an installation script to simplify set up.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferbridge%2Fgit-pair","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ferbridge%2Fgit-pair","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ferbridge%2Fgit-pair/lists"}