{"id":19461669,"url":"https://github.com/plasmapower/ghcl","last_synced_at":"2025-04-25T07:34:18.878Z","repository":{"id":62439449,"uuid":"95980838","full_name":"PlasmaPower/ghcl","owner":"PlasmaPower","description":"GitHub CLone: automatically fork, clone, and setup an upstream remote for a GitHub repository","archived":false,"fork":false,"pushed_at":"2019-12-02T02:24:44.000Z","size":45,"stargazers_count":24,"open_issues_count":5,"forks_count":2,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-10-13T14:12:57.881Z","etag":null,"topics":["command-line","git","github","utility"],"latest_commit_sha":null,"homepage":null,"language":"Rust","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/PlasmaPower.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2017-07-01T18:22:15.000Z","updated_at":"2023-09-17T04:45:13.000Z","dependencies_parsed_at":"2022-11-01T22:01:43.609Z","dependency_job_id":null,"html_url":"https://github.com/PlasmaPower/ghcl","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlasmaPower%2Fghcl","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlasmaPower%2Fghcl/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlasmaPower%2Fghcl/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PlasmaPower%2Fghcl/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PlasmaPower","download_url":"https://codeload.github.com/PlasmaPower/ghcl/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223991344,"owners_count":17237476,"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":["command-line","git","github","utility"],"created_at":"2024-11-10T17:43:19.055Z","updated_at":"2024-11-10T17:43:19.773Z","avatar_url":"https://github.com/PlasmaPower.png","language":"Rust","readme":"# ghcl: GitHub CLone\n\nAutomatically fork, clone, and setup an upstream remote for a GitHub repository. By default, the master branch will track the upstream remote.\n\nIntended as a \"quick-start\" for contributing to a GitHub repository.\nMore services such as GitLab and BitBucket are coming soon™. The code is ready for multiple services, but the APIs for them haven't been implemented.\n\nThis project is licensed under the terms of the MIT license. See `LICENSE.txt` for more details\n\n## Installation\n\nThis project requires a `libgit2`, and `cmake` for building.\n\nCurrently, all methods of installation require building from source, and a working Rust installation.\nTo quickly setup Rust (and Cargo), use [rustup](https://rustup.rs).\n\n- Through crates.io: `cargo install ghcl`\n- Through GitHub:\n  ```sh\n  git clone https://github.com/PlasmaPower/ghcl.git\n  cd ghcl\n  cargo build --release\n  sudo cp target/release/ghcl /usr/bin # or just cargo install, to install for just your user\n  ```\n\n## Arguments\n\n```\nghcl 0.1.0\nLee Bousfield \u003cemail redacted here to prevent spam\u003e\nAutomatically forks and clones a GitHub repository\n\nUSAGE:\n    ghcl [FLAGS] [OPTIONS] \u003cREPOSITORY\u003e [CLONE_PATH]\n\nFLAGS:\n    -h, --help                 Prints help information\n        --no-quiet             Don't be quiet (output status messages)\n        --no-track-upstream    Don't setup master to track upstream\n        --no-upstream          Don't setup an upstream remote (implies no_track_upstream)\n    -q, --quiet                Don't output status messages\n        --setup-upstream       Setup an upstream remote (default)\n        --track-upstream       Setup master to track upstream (default, imples setup-upstream)\n    -V, --version              Prints version information\n\nOPTIONS:\n    -c, --config \u003cFILE\u003e                       Sets a custom config file\n    -s, --default-service \u003cSERVICE\u003e           The service to be used if the repository is in the form user/repo [values: github, GitHub, Github]\n        --fork-timeout \u003cTIMEOUT\u003e              The maximum timeout for the fork creation (default: 30)\n    -o, --organization \u003cORGANIZATION\u003e         Fork into an organization\n        --origin-protocol \u003cGIT_PROTOCOL\u003e      The git protocol to use for the origin (default: SSH) [values: ssh, https, SSH, HTTPS]\n    -p, --password \u003cPASSWORD\u003e                 Your password (insecure - use a personal access token and put it in your config, or input your password when prompted)\n        --remote-name \u003cREMOTE_NAME\u003e           The name of the upstream remote to create (default: \"upstream\")\n        --upstream-protocol \u003cGIT_PROTOCOL\u003e    The git protocol to use for the upstream (default: HTTPS) [values: ssh, https, SSH, HTTPS]\n    -u, --username \u003cUSERNAME\u003e                 Your username\n\nARGS:\n    \u003cREPOSITORY\u003e    Repository to fork and clone\n    \u003cCLONE_PATH\u003e    Where to clone the repository (defaults to the name of the repo)\n```\n\n## Config\n\nThe config is located in:\n\n- Linux: `~/.config/ghcl/config.yml` (or `$XDG_CONFIG_HOME/ghcl/config.yml`)\n- MacOS: `~/Library/Application Support/ghcl/config.yml`\n- Windows: `%APPDATA%\\PlasmaPower\\ghcl`\n\nContents (all of which are optional, and can be overriden by arguments):\n\n| Key               | Type/valid values   | Description                                                                                    |\n|-------------------|---------------------|------------------------------------------------------------------------------------------------|\n| organization      | String              | the organization to clone repositories to                                                      |\n| track_upstream    | bool                | should the master branch be setup to track upstream? (if true, setup_upstream cannot be false) |\n| setup_upstream    | bool                | should the upstream remote be created?                                                         |\n| remote_name       | String              | the name of the upstream remote to create (only used if setup_upstream is true)                |\n| origin_protocol   | HTTPS or SSH        | the protocol to use for the origin remote                                                      |\n| upstream_protocol | HTTPS or SSH        | the protocol to use for the upstream remote (only used if setup_upstream is true)              |\n| default_service   | only github for now | the service to use if the repository is in the form of \"user/repository\"                       |\n| quiet             | bool                | should status messages be outputed?                                                            |\n| fork_timeout      | integer             | the maximum total timeout for attempting to clone after a fork                                 |\n| authentication    | map - see below     | authentication (usually username + password) for each service                                  |\n\nAuthentication is a map of service (currently only \"github\") to a username and password.\nWith GitHub, you can (and it's recommended to) use a personal access token with the \"repo\" permission instead of an actual password.\nThat way, it has limited permissions, and can be easily revoked.\n\nExample config:\n\n```yaml\norganization: myOrg\ntrack_upstream: false\nsetup_upstream: true\nremote_name: my-upstream\norigin_protocol: SSH\nupstream_protocol: HTTPS\ndefault_service: github\nquiet: true\nfork_timeout: 30\nauthentication:\n  github:\n    username: ExampleUser\n    password: efbfd4e43d8e77c1dc24... # personal access token\n```\n\n## FAQ\n\n### When I use ghcl, it freezes after \"Cloning repository...\"\nThat probably means your SSH agent is misconfigured.\nI'm not sure why it causes a freeze, but to fix it, run `ssh-add ~/.ssh/id_rsa`, or whatever your GitHub SSH key is.\nYou should also put that in your `.profile`, or wherever you start `ssh-agent`.\n\n### This program doesn't fit my workflow!\nThis program is opinionated, and not intended to fit every workflow.\nHowever, if it's just a small option that's missing, feel free to create an issue or pull request.\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplasmapower%2Fghcl","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fplasmapower%2Fghcl","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fplasmapower%2Fghcl/lists"}