{"id":18778728,"url":"https://github.com/viko16/git-cd","last_synced_at":"2026-04-28T23:34:31.624Z","repository":{"id":75763942,"uuid":"136867828","full_name":"viko16/git-cd","owner":"viko16","description":"👷 git clone ⇒ run hooks (optional) ⇒ cd","archived":false,"fork":false,"pushed_at":"2018-07-07T02:02:59.000Z","size":9,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-05-13T16:24:23.061Z","etag":null,"topics":["cli","git","repository-management"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/viko16.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","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":"2018-06-11T03:04:03.000Z","updated_at":"2018-08-26T11:37:58.000Z","dependencies_parsed_at":"2023-03-08T06:15:35.710Z","dependency_job_id":null,"html_url":"https://github.com/viko16/git-cd","commit_stats":{"total_commits":11,"total_committers":1,"mean_commits":11.0,"dds":0.0,"last_synced_commit":"346b9edbdff0435b618557ddf9dd20d5b3d1c592"},"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viko16%2Fgit-cd","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viko16%2Fgit-cd/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viko16%2Fgit-cd/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/viko16%2Fgit-cd/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/viko16","download_url":"https://codeload.github.com/viko16/git-cd/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":239690074,"owners_count":19681035,"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":["cli","git","repository-management"],"created_at":"2024-11-07T20:17:08.681Z","updated_at":"2025-12-17T17:30:17.666Z","avatar_url":"https://github.com/viko16.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# git-cd\n\n[![Build Status](https://img.shields.io/travis/viko16/git-cd.svg?style=flat)](https://travis-ci.org/viko16/git-cd)\n[![NPM version](https://img.shields.io/npm/v/git-cd.svg?style=flat)](https://npmjs.org/package/git-cd)\n[![JavaScript Style Guide](https://img.shields.io/badge/code%20style-standard-brightgreen.svg?style=flat)](http://standardjs.com/)\n\n\n\u003e 👷 cd dir after git clone if not exist\n\n\n\n## Installation\n\n``` sh\n$ npm i git-cd -g\n```\n\n\n\n## Usage\n\n``` sh\n$ git-cd \u003crepoUrl\u003e\n```\n\nSet up `BASE` directory: \n\n```sh\n$ git config --global ghq.root THE_PATH_YOU_WANT\n```\n\nBy default, the repository is cloned via SSH protocol. Or you can pass `--inherit-url` flag to disable it.\n\n\n## Required\n\n[motemen/ghq](https://github.com/motemen/ghq): Remote repository management made easy\n\n```sh\ngo get github.com/motemen/ghq\n```\n\n\n\n## How it works\n\n1. Clone a remote repository under the BASE directory. Just like `git clone`.\n2. Run hook if exists. (Optional)\n3. Change current directory to cloned repository with the shell.\n\n\n\n## Hook\n\nPut file in `~/.git-cd/hook.js` , and write anything in nodo.js.\n\nExample:\n``` sh\n$ mkdir -p ~/.git-cd\n$ echo \"console.log('hook receives:', process.argv[2])\" \u003e ~/.git-cd/hook.js\n```\n\n\n\n## Directory Structures\n\n```\n$BASE\n├── github.com\n│   └── foo\n│       └── bar\n└── gitlab.com\n    └── foo\n        └── bar\n```\n\n\n\n## License\n\n[MIT License](https://opensource.org/licenses/MIT) © [viko16](https://github.com/viko16)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviko16%2Fgit-cd","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fviko16%2Fgit-cd","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fviko16%2Fgit-cd/lists"}