{"id":22931356,"url":"https://github.com/hunleyd/gwt","last_synced_at":"2025-08-12T15:32:07.586Z","repository":{"id":65418512,"uuid":"591993894","full_name":"hunleyd/gwt","owner":"hunleyd","description":"gwt - a Git worktree wrapper","archived":false,"fork":false,"pushed_at":"2024-07-12T16:05:27.000Z","size":63,"stargazers_count":2,"open_issues_count":2,"forks_count":1,"subscribers_count":2,"default_branch":"main","last_synced_at":"2025-03-15T13:03:31.137Z","etag":null,"topics":["git","shell-script","worktrees"],"latest_commit_sha":null,"homepage":"","language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/hunleyd.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":"2023-01-22T15:49:22.000Z","updated_at":"2024-11-07T02:17:59.000Z","dependencies_parsed_at":"2023-11-15T19:28:51.173Z","dependency_job_id":"a1a1a083-9c3e-404a-b874-5c83e7d715cb","html_url":"https://github.com/hunleyd/gwt","commit_stats":null,"previous_names":[],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/hunleyd/gwt","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunleyd%2Fgwt","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunleyd%2Fgwt/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunleyd%2Fgwt/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunleyd%2Fgwt/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hunleyd","download_url":"https://codeload.github.com/hunleyd/gwt/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hunleyd%2Fgwt/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":270086841,"owners_count":24524655,"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","status":"online","status_checked_at":"2025-08-12T02:00:09.011Z","response_time":80,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","shell-script","worktrees"],"created_at":"2024-12-14T10:38:49.252Z","updated_at":"2025-08-12T15:32:07.301Z","avatar_url":"https://github.com/hunleyd.png","language":null,"funding_links":[],"categories":[],"sub_categories":[],"readme":"\n[![GPLv2 License](https://img.shields.io/badge/License-GPL%20v2-yellow.svg)](https://opensource.org/licenses/)\n# gwt - a Git worktree wrapper\n\n`gwt` is a Bash function to make working with [git worktree](https://git-scm.com/docs/git-worktree) a little easier. It provides functionality for listing all existing worktrees, creating new worktrees, removing stale worktrees, and automates updating a worktree upon entering it.\n\n## Environment Variables\n\nTo run this project, you will need to add the following environment variables to your .env file\n\n`GWT_REPO_HOME`\n\n## Usage/Examples\n\n### Set up / Configuration\n\n1. Tell `gwt` where your Git repos live\n```sh\n~ $ export GWT_REPO_HOME=/srv/repos\n```\n2. Load `gwt` into your current shell\n```sh\n~ $ source /path/to/gwt\n```\n\n### Usage\n\n#### List all worktrees in all repositories\n\n```sh\n~ $ gwt\n/srv/repos/demo\n↳ ask_me_about_free_upgrades                       48f9fefb8 [ask_me_about_free_upgrades]\n↳ because_it_zee_standard                          08885f5f8 [because_it_zee_standard]\n↳ bye_bye_ssh_hello_tls                            96e7caa91 [bye_bye_ssh_hello_tls]\n↳ clusters_have_names                              47441094e [clusters_have_names]\n↳ compute_pg_defaults                              f17eb3306 [compute_pg_defaults]\n↳ computed_processes                               b2b0f4b75 [computed_processes]\n↳ development                                      05f001eee [development]\n↳ etcd_api_v3                                      fb0c287e3 [etcd_api_v3]\n↳ heap-2660                                        67ed98aa9 [heap-2660]\n↳ heap-2661                                        0b00da61f [heap-2661]\n↳ ini_mini_miti_mo                                 1317ffaa1 [ini_mini_miti_mo]\n↳ int_int_baby                                     4b38207c0 [int_int_baby]\n↳ lint_lint_baby                                   ae72361e5 [lint_lint_baby]\n↳ make_fetch_happen_for_gretchen                   bb74fe721 [make_fetch_happen_for_gretchen]\n↳ pls_get_fresh_with_me                            4f2b6579f [pls_get_fresh_with_me]\n↳ prepare_this                                     9d011fd4e [prepare_this]\n↳ raft_beta                                        6ac90e7a0 [raft_beta]\n↳ repov2                                           5020895e3 [repov2]\n↳ rhel_9                                           27c2c4cf6 [rhel_9]\n↳ unlimited_cosmic_files__itty_bitty_living_space  257c64a34 [unlimited_cosmic_files__itty_bitty_living_space]\n↳ use_the_modules_luke                             a3d0d96af [use_the_modules_luke]\n↳ validate_patroni                                 bd13c04a6 [validate_patroni]\n↳ what_does_inactive_even_mean                     fcdc9c36e [what_does_inactive_even_mean]\n↳ what_is_a_default_anyway                         d9ef509b1 [what_is_a_default_anyway]\n↳ wilson_and_me_on_a_raft                          6184f8da0 [wilson_and_me_on_a_raft]\n\n/srv/repos/set_user\n↳ v4_upgrade_note  6b385b2 [v4_upgrade_note]\n\n/srv/repos/pgmonitor\n↳ development  da0824c [development]\n```\n\n#### List all worktrees in a given repo\n\n```sh\n~ $ gwt ls demo\ndemo\n↳ ask_me_about_free_upgrades                       48f9fefb8 [ask_me_about_free_upgrades]\n↳ because_it_zee_standard                          08885f5f8 [because_it_zee_standard]\n↳ bye_bye_ssh_hello_tls                            96e7caa91 [bye_bye_ssh_hello_tls]\n↳ clusters_have_names                              47441094e [clusters_have_names]\n↳ compute_pg_defaults                              f17eb3306 [compute_pg_defaults]\n↳ computed_processes                               b2b0f4b75 [computed_processes]\n↳ development                                      05f001eee [development]\n↳ etcd_api_v3                                      fb0c287e3 [etcd_api_v3]\n↳ heap-2660                                        67ed98aa9 [heap-2660]\n↳ heap-2661                                        0b00da61f [heap-2661]\n↳ ini_mini_miti_mo                                 1317ffaa1 [ini_mini_miti_mo]\n↳ int_int_baby                                     4b38207c0 [int_int_baby]\n↳ lint_lint_baby                                   ae72361e5 [lint_lint_baby]\n↳ make_fetch_happen_for_gretchen                   bb74fe721 [make_fetch_happen_for_gretchen]\n↳ pls_get_fresh_with_me                            4f2b6579f [pls_get_fresh_with_me]\n↳ prepare_this                                     9d011fd4e [prepare_this]\n↳ raft_beta                                        6ac90e7a0 [raft_beta]\n↳ repov2                                           5020895e3 [repov2]\n↳ rhel_9                                           27c2c4cf6 [rhel_9]\n↳ unlimited_cosmic_files__itty_bitty_living_space  257c64a34 [unlimited_cosmic_files__itty_bitty_living_space]\n↳ use_the_modules_luke                             a3d0d96af [use_the_modules_luke]\n↳ validate_patroni                                 bd13c04a6 [validate_patroni]\n↳ what_does_inactive_even_mean                     fcdc9c36e [what_does_inactive_even_mean]\n↳ what_is_a_default_anyway                         d9ef509b1 [what_is_a_default_anyway]\n↳ wilson_and_me_on_a_raft                          6184f8da0 [wilson_and_me_on_a_raft]\n```\n\n#### Create a new worktree\n\n```sh\n~ $ gwt create demo demo\ngwt: Checking if upstream is a fetchable remote\ngwt: Fetching remote: upstream\ngwt: Checking if development is a valid head on upstream remote\ngwt: Creating worktree\nPreparing worktree (new branch 'demo')\nbranch 'demo' set up to track 'upstream/development'.\nHEAD is now at eec1595f1 update readme and contrib (#2056)\ngwt: Checking if this repo uses submodules\ngwt: No submodules configured in this repo\n/srv/repos/demo/.trees/demo $\n```\n\n#### Switch to an existing worktree\n\n```sh\n~ $ gwt demo\ngwt: Found the demo worktree\ngwt: Checking if a merge is in progress\ngwt: A merge IS NOT in progress\ngwt: Determining the worktree's branch revision\ngwt: Local worktree's branch revision: eec1595f1e2cc682e831678b47691ed2e13c835b\ngwt: Fetching info from remote: origin\ngwt: Checking if this branch exists on remote: origin\ngwt: This worktree's branch not found on remote: origin\ngwt: Determining the upstream remote for this branch\ngwt: Determined the upstream remote for this branch: upstream\ngwt: Determining the upstream branch for this branch\ngwt: Determined the upstream branch for this branch: development\ngwt: Fetching info from remote: upstream\ngwt: Checking if upstream/development has advanced since last pull\ngwt: Remote head has not advanced\n/srv/repos/demo/.trees/demo $\n```\n\n#### Switch to a worktree where upstream has advanced\n```sh\n~ $ gwt heap-2660\ngwt: Found the heap-2660 worktree\ngwt: Checking if a merge is in progress\ngwt: A merge IS NOT in progress\ngwt: Determining the worktree's branch revision\ngwt: Local worktree's branch revision: 67ed98aa9b2457d1ffede13545276fd7f0b57c1f\ngwt: Fetching info from remote: origin\ngwt: Checking if this branch exists on remote: origin\ngwt: Checking the revision of this branch on: origin\ngwt: Remote origin has this branch on revision: 67ed98aa9b2457d1ffede13545276fd7f0b57c1f\ngwt: Checking the base revision of this branch on: origin\ngwt: Revisions match; continuing\ngwt: Determining the upstream remote for this branch\ngwt: Determined the upstream remote for this branch: upstream\ngwt: Determining the upstream branch for this branch\ngwt: Determined the upstream branch for this branch: development\ngwt: Fetching info from remote: upstream\ngwt: Checking if upstream/development has advanced since last pull\ngwt: Merging from remote head: upstream/development\n/srv/repos/demo/.trees/heap-2660 $\n```\n\n#### Switch to a worktree with unpushed local commits\n\n```sh\n~ $ gwt heap-2660\ngwt: Found the heap-2660 worktree\ngwt: Checking if a merge is in progress\ngwt: A merge IS NOT in progress\ngwt: Determining the worktree's branch revision\ngwt: Local worktree's branch revision: 36d59ff8d56a86e402a99f9c6ce3746c36643fd8\ngwt: Fetching info from remote: origin\ngwt: Checking if this branch exists on remote: origin\ngwt: Checking the revision of this branch on: origin\ngwt: Remote origin has this branch on revision: 67ed98aa9b2457d1ffede13545276fd7f0b57c1f\ngwt: Checking the base revision of this branch on: origin\ngwt: Pushing to remote: origin\ngwt: Determining the upstream remote for this branch\ngwt: Determined the upstream remote for this branch: upstream\ngwt: Determining the upstream branch for this branch\ngwt: Determined the upstream branch for this branch: development\ngwt: Fetching info from remote: upstream\ngwt: Checking if upstream/development has advanced since last pull\ngwt: Merging from remote head: upstream/development\nAlready up to date.\n/srv/repos/demo/.trees/heap-2660 $\n```\n\n#### Remove a worktree\n\n```sh\n~ $ gwt prune demo demo\ngwt: Removing the worktree from disk: /srv/repos/demo/.trees/demo\ngwt: Deleting the branch: demo\nDeleted branch demo (was eec1595f1).\n~ $\n```\n## License\n\n[GPLv2](https://choosealicense.com/licenses/gpl-2.0/)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhunleyd%2Fgwt","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhunleyd%2Fgwt","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhunleyd%2Fgwt/lists"}