{"id":23171706,"url":"https://github.com/smarthypercube/git-tmp","last_synced_at":"2025-07-03T14:07:17.581Z","repository":{"id":127489425,"uuid":"440070867","full_name":"SmartHypercube/git-tmp","owner":"SmartHypercube","description":"Checkout a clean copy into a temporary directory.","archived":false,"fork":false,"pushed_at":"2024-06-06T07:49:44.000Z","size":2,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-04T23:42:50.877Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","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/SmartHypercube.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":"2021-12-20T06:52:01.000Z","updated_at":"2024-06-06T07:49:47.000Z","dependencies_parsed_at":null,"dependency_job_id":"b443a2a5-7ceb-433b-8cdd-428b5084a811","html_url":"https://github.com/SmartHypercube/git-tmp","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/SmartHypercube/git-tmp","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartHypercube%2Fgit-tmp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartHypercube%2Fgit-tmp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartHypercube%2Fgit-tmp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartHypercube%2Fgit-tmp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SmartHypercube","download_url":"https://codeload.github.com/SmartHypercube/git-tmp/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SmartHypercube%2Fgit-tmp/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263339928,"owners_count":23451516,"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":[],"created_at":"2024-12-18T04:19:18.096Z","updated_at":"2025-07-03T14:07:17.557Z","avatar_url":"https://github.com/SmartHypercube.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Checkout a clean copy into a temporary directory\n\nThis command lets you checkout a clean copy of a repository into a temporary directory. It is useful when you want to test something without either affecting the current working directory or being affected by the ignored files in the current working directory.\n\nExample:\n\n```bash\n~/Projects/git-tmp$ git tmp\nPreparing worktree (detached HEAD 4750c17)\nHEAD is now at 4750c17 init\nYou are now at: /tmp/tmpwih1dkjq\nThis directory will be removed if not changed when exiting this shell.\n/tmp/tmpwih1dkjq$ # you are now in a clean copy of the repository\n/tmp/tmpwih1dkjq$ exit\n~/Projects/git-tmp$\n```\n\n## Installation\n\nCopy the `git-tmp` script to somewhere in your `$PATH`.\n\n## How it works\n\nThe `git-tmp` script creates a temporary directory and makes it a [working tree](https://git-scm.com/docs/git-worktree) of current git repository. Then it spawns a shell in this directory.\n\nWorking trees created in this way will contain an extra file `.git` which points to the original repository. The script will remove this file to make sure the temporary directory only contains committed files.\n\nAfter the shell exits, it tries to remove this working tree only if the content has not been changed.\n\n## Disclaimer\n\nThis script is not tested with all possible edge cases. Use at your own risk. It should be very safe though.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmarthypercube%2Fgit-tmp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsmarthypercube%2Fgit-tmp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsmarthypercube%2Fgit-tmp/lists"}