{"id":24794229,"url":"https://github.com/joematthews/worktree-make","last_synced_at":"2025-03-24T17:47:58.963Z","repository":{"id":241614237,"uuid":"805095629","full_name":"joematthews/worktree-make","owner":"joematthews","description":"An easier way to make git worktrees and branches for projects that have multiple repositories.","archived":false,"fork":false,"pushed_at":"2024-06-04T21:08:47.000Z","size":12,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-01-29T22:44:50.557Z","etag":null,"topics":["git-worktree","worktree","worktrees"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/joematthews.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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":"2024-05-23T21:54:36.000Z","updated_at":"2024-10-31T18:23:04.000Z","dependencies_parsed_at":"2024-06-04T23:08:52.889Z","dependency_job_id":null,"html_url":"https://github.com/joematthews/worktree-make","commit_stats":null,"previous_names":["joematthews/worktree-make"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joematthews%2Fworktree-make","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joematthews%2Fworktree-make/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joematthews%2Fworktree-make/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/joematthews%2Fworktree-make/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/joematthews","download_url":"https://codeload.github.com/joematthews/worktree-make/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":245321629,"owners_count":20596387,"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-worktree","worktree","worktrees"],"created_at":"2025-01-29T22:35:08.327Z","updated_at":"2025-03-24T17:47:58.913Z","avatar_url":"https://github.com/joematthews.png","language":"Shell","readme":"# worktree-make 🐙\n\n```sh\n# arguments\nworktree-make \u003cbranch_create\u003e [\u003cbranch_from\u003e]\n```\n\nAn easier way to make [git worktrees](https://git-scm.com/docs/git-worktree) and branches for projects that have multiple repositories.\n\n- [Installation](#installation)\n  - [Quick Install](#quick-install)\n  - [Local Install](#local-install)\n- [Basic Usage](#basic-usage)\n- [Multiple Repositories](#multiple-repositories)\n- [Clean up](#clean-up-worktrees--branches)\n\n## Installation\n\nReview the [install.sh](install.sh) and [worktree-make.sh](worktree-make.sh) files before installing.\n\n### Quick Install\n\nFor easy installation. Run the following curl statement to add the `worktree-make` function to your shell configuration file. Append the statement with the name of the target configuration file.\n\nFor example, if using Bash on Linux:\n\n```sh\ncurl https://raw.githubusercontent.com/joematthews/worktree-make/main/install.sh | bash -s -- ~/.bashrc\n```\n\nOr, if using Zsh on macOS:\n\n```sh\ncurl https://raw.githubusercontent.com/joematthews/worktree-make/main/install.sh | bash -s -- ~/.zshrc\n```\n\nThen run `source` on the configuration file (~/.zshrc in this example):\n\n```sh\nsource ~/.zshrc\n```\n\n### Local Install\n\nClone the repository and run the [install.sh script](install.sh). Append the statement with your shell configuration file (~/.zshrc in this example):\n\n```sh\ngit clone git@github.com:joematthews/worktree-make.git\n./install.sh ~/.zshrc\nsource ~/.zshrc\n```\n\n## Basic Usage\n\nTo quickly create a worktree within a git repository, enter a branch name:\n\n```sh\ncd project-repository\nworktree-make feat/555-products-backorder\n```\n\nThis will create a new directory at `../worktrees/feat/555-products-backorder/project-repository` and then change to that directory automatically with `pushd`. The `feat/555-products-backorder` branch will already by checked out.\n\nTo return to the original repository use `popd`.\n\n## Specify 'From Branch'\n\nBy default, worktree-make branches off of `main`. To branch off of a different branch, append the branch name to the end:\n\n```sh\nworktree-make feat/555-products-backorder master\n```\n\n## Multiple Repositories\n\nThe generated directory structure is helpful because some projects have multiple repositories (ex: backend and frontend).\n\nIf the same exact branch name is chosen (ex: `chore/666-refactor-users`), then multiple repositories will reside within the directory for that branch. For example:\n\n```sh\n# terminal 1\ncd project-frontend\nworktree-make chore/666-refactor-users\n\n# terminal 2\ncd project-backend\nworktree-make chore/666-refactor-users\n```\n\n...will generate the following directories:\n\n```\n../worktrees/chore/666-refactor-users/project-frontend\n\n../worktrees/chore/666-refactor-users/project-backend\n```\n\n## Clean up worktrees \u0026 branches\n\nTo clean up the worktrees simply delete the parent branch directory:\n\n```sh\nrm -r worktrees/chore/666-refactor-users\n```\n\nAnd then for each related repository, prune the worktrees:\n\n```sh\n# within project-frontend \u0026 project-backend\ngit worktree prune\n```\n\nAnd then finally, delete the branch in each repository:\n\n```sh\n# within project-frontend \u0026 project-backend\ngit branch -d chore/666-refactor-users\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoematthews%2Fworktree-make","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjoematthews%2Fworktree-make","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjoematthews%2Fworktree-make/lists"}