{"id":29948323,"url":"https://github.com/revan-zhang/git-clone-hook","last_synced_at":"2025-08-03T08:12:22.660Z","repository":{"id":127551238,"uuid":"102259737","full_name":"revan-zhang/git-clone-hook","owner":"revan-zhang","description":"git clone hook for auto changing directory.","archived":false,"fork":false,"pushed_at":"2017-09-24T03:35:00.000Z","size":3,"stargazers_count":12,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-04T23:21:55.878Z","etag":null,"topics":["git","hooks","tool"],"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/revan-zhang.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":"2017-09-03T11:26:50.000Z","updated_at":"2023-03-04T05:48:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"f9b93c13-622d-40a0-b820-8642d93e3743","html_url":"https://github.com/revan-zhang/git-clone-hook","commit_stats":null,"previous_names":["revan-zhang/git-clone-hook"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/revan-zhang/git-clone-hook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revan-zhang%2Fgit-clone-hook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revan-zhang%2Fgit-clone-hook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revan-zhang%2Fgit-clone-hook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revan-zhang%2Fgit-clone-hook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/revan-zhang","download_url":"https://codeload.github.com/revan-zhang/git-clone-hook/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/revan-zhang%2Fgit-clone-hook/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":268512159,"owners_count":24261887,"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-03T02:00:12.545Z","response_time":2577,"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","hooks","tool"],"created_at":"2025-08-03T08:12:19.222Z","updated_at":"2025-08-03T08:12:22.643Z","avatar_url":"https://github.com/revan-zhang.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-clone-hook\nAutomaticlly change directory to the folder after `git clone`\n\n# install\n\n```shell\ncurl https://raw.githubusercontent.com/loatheb/git-clone-hook/master/index.sh | bash\n```\n\n# thanks\n\nThanks [how-to-cd-automatically-after-git-clone](https://unix.stackexchange.com/questions/97920/how-to-cd-automatically-after-git-clone) for giving me inspiration.\n\nIt's really hard for me to command `cd` somewhere everytime after `git clone`.So I want to find a way to do it automatically.\n\nThe question above have many solutions, but they all need I to add them in `~/.zshrc` or `~/.bashrc` by myself.So I write this simple script to detect and write the main function whenever you use bash or zsh.\n\n# technical details\n\nsome commands are use\n1. `basename`\n\u003eit will delete any prefix up to the last slash ('/') character and return the result.\n\n2. `mktemp`\n\u003eit will creates a temporary file or directory.\n\n3. `tee`\n\u003eit reads standard input and writes it to both standard output and one or more files, effectively duplicating its input.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevan-zhang%2Fgit-clone-hook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frevan-zhang%2Fgit-clone-hook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frevan-zhang%2Fgit-clone-hook/lists"}