clone-repo


Nameclone-repo JSON
Version 1.0.1 PyPI version JSON
download
home_pagehttps://github.com/micktwomey/clone-repo
SummaryCLI tool to clone repos easily
upload_time2025-10-25 17:40:40
maintainerNone
docs_urlNone
authorMichael Twomey
requires_python<4.0,>=3.9
licenseMIT
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # clone-repo: Easily clone repos

- [Home](https://github.com/micktwomey/clone-repo)
- [PyPI](https://pypi.org/project/clone-repo/)

## What is this?

For years I've been using a noddy script which clones many types of repos into a fixed location which is generated based on the repo itself. Similar to how go packages are cloned into go/src I typically clone my stuff into ~/src.

e.g. `clone-repo git@github.com:micktwomey/clone-repo.git` will clone using git to `~/src/github.com/micktwomey/clone-repo`.

This allows me to clone many different repos without worrying about stepping on each other. It also makes it easy to see where stuff comes from (e.g. `rm -rf ~/src/old.git.example.com` will wipe out clones from git server I don't use any more).

Install via `pip install clone-repo`.

Install with [pipx](https://pypa.github.io/pipx/) using `pipx install clone-repo` to make it available as a CLI tool everywhere.

Supports:

- `/path/to/repo`
  - `git clone` to `~/src/localhost/file/{repo}`
- `file:///path/to/repo`
  - `git clone` to `~/src/localhost/file/{repo}`
- `git@example.com:org/repo.git`
  - `git clone` to `~/src/{host}/{org}/{repo}`
- `https://github.com/org/repo.git`
  - `git clone` to `~/src/github.com/{org}/{repo}`
- `https://github.com/org/repo`
  - `git clone` to `~/src/github.com/{org}/{repo}`
- `https://gitlab.example.com/org/repo.git`
  - `git clone` to `~/src/{host}/{org}/{repo}`
- `https://hg.mozilla.org/mozilla-central/`
  - `hg clone` to `~/src/hg.mozilla.org/{org}/{repo}`
- `https://hg.sr.ht/~org/repo`
  - `hg clone` to `~/src/hg.sr.ht/{org}/{repo}`
- `keybase://team/org/repo`
  - `git clone` to `~/src/keybase/{org}/{repo}`
- `man@man.sr.ht:~org/repo`
  - `git clone` to `~/src/man.sr.ht/{org}/{repo}`
- `ssh://git@example.com:7999/somegroup/myrepo.git`
  - `git clone` to `~/src/{host}/{org}/{repo}`
- `ssh://hg@bitbucket.org/org/repo`
  - `hg clone` to `~/src/{host}/{org}/{repo}`

For `https://` URLs the default is git but some will behave differently based on the domain.

# Development

If you want to quickly develop you can use [poetry](https://python-poetry.org) and [pytest](https://pytest.org/):

1. `poetry install`
2. `pytest -vv`

If you want to test across all supported Python versions you can install them via [asdf](https://asdf-vm.com) and then use [nox](https://nox.thea.codes):

1. `asdf install`
2. `poetry install`
3. `nox`

If you want to run [pre-commit](https://pre-commit.com) hooks before committing:

1. `poetry install`
2. `pre-commit install`

Finally, there is a [just](https://github.com/casey/just) justfile to run some commands.

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/micktwomey/clone-repo",
    "name": "clone-repo",
    "maintainer": null,
    "docs_url": null,
    "requires_python": "<4.0,>=3.9",
    "maintainer_email": null,
    "keywords": null,
    "author": "Michael Twomey",
    "author_email": "mick@twomeylee.name",
    "download_url": "https://files.pythonhosted.org/packages/52/bf/d534789925af51820c14851e0d4d9f31b0f2799f0d9879bdd29632a69226/clone_repo-1.0.1.tar.gz",
    "platform": null,
    "description": "# clone-repo: Easily clone repos\n\n- [Home](https://github.com/micktwomey/clone-repo)\n- [PyPI](https://pypi.org/project/clone-repo/)\n\n## What is this?\n\nFor years I've been using a noddy script which clones many types of repos into a fixed location which is generated based on the repo itself. Similar to how go packages are cloned into go/src I typically clone my stuff into ~/src.\n\ne.g. `clone-repo git@github.com:micktwomey/clone-repo.git` will clone using git to `~/src/github.com/micktwomey/clone-repo`.\n\nThis allows me to clone many different repos without worrying about stepping on each other. It also makes it easy to see where stuff comes from (e.g. `rm -rf ~/src/old.git.example.com` will wipe out clones from git server I don't use any more).\n\nInstall via `pip install clone-repo`.\n\nInstall with [pipx](https://pypa.github.io/pipx/) using `pipx install clone-repo` to make it available as a CLI tool everywhere.\n\nSupports:\n\n- `/path/to/repo`\n  - `git clone` to `~/src/localhost/file/{repo}`\n- `file:///path/to/repo`\n  - `git clone` to `~/src/localhost/file/{repo}`\n- `git@example.com:org/repo.git`\n  - `git clone` to `~/src/{host}/{org}/{repo}`\n- `https://github.com/org/repo.git`\n  - `git clone` to `~/src/github.com/{org}/{repo}`\n- `https://github.com/org/repo`\n  - `git clone` to `~/src/github.com/{org}/{repo}`\n- `https://gitlab.example.com/org/repo.git`\n  - `git clone` to `~/src/{host}/{org}/{repo}`\n- `https://hg.mozilla.org/mozilla-central/`\n  - `hg clone` to `~/src/hg.mozilla.org/{org}/{repo}`\n- `https://hg.sr.ht/~org/repo`\n  - `hg clone` to `~/src/hg.sr.ht/{org}/{repo}`\n- `keybase://team/org/repo`\n  - `git clone` to `~/src/keybase/{org}/{repo}`\n- `man@man.sr.ht:~org/repo`\n  - `git clone` to `~/src/man.sr.ht/{org}/{repo}`\n- `ssh://git@example.com:7999/somegroup/myrepo.git`\n  - `git clone` to `~/src/{host}/{org}/{repo}`\n- `ssh://hg@bitbucket.org/org/repo`\n  - `hg clone` to `~/src/{host}/{org}/{repo}`\n\nFor `https://` URLs the default is git but some will behave differently based on the domain.\n\n# Development\n\nIf you want to quickly develop you can use [poetry](https://python-poetry.org) and [pytest](https://pytest.org/):\n\n1. `poetry install`\n2. `pytest -vv`\n\nIf you want to test across all supported Python versions you can install them via [asdf](https://asdf-vm.com) and then use [nox](https://nox.thea.codes):\n\n1. `asdf install`\n2. `poetry install`\n3. `nox`\n\nIf you want to run [pre-commit](https://pre-commit.com) hooks before committing:\n\n1. `poetry install`\n2. `pre-commit install`\n\nFinally, there is a [just](https://github.com/casey/just) justfile to run some commands.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "CLI tool to clone repos easily",
    "version": "1.0.1",
    "project_urls": {
        "Homepage": "https://github.com/micktwomey/clone-repo",
        "Repository": "https://github.com/micktwomey/clone-repo"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "ec9dd03812ee35c790e31496e9afe0f7a34d66bf54a97f1724c2cfa1134305b5",
                "md5": "0f629778fa077f9c0446ffb2884c73b0",
                "sha256": "bf3851de97bea717fca0383c46fb00c93e55e3473db26811fbd3636dbe011d20"
            },
            "downloads": -1,
            "filename": "clone_repo-1.0.1-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "0f629778fa077f9c0446ffb2884c73b0",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 6062,
            "upload_time": "2025-10-25T17:40:39",
            "upload_time_iso_8601": "2025-10-25T17:40:39.205519Z",
            "url": "https://files.pythonhosted.org/packages/ec/9d/d03812ee35c790e31496e9afe0f7a34d66bf54a97f1724c2cfa1134305b5/clone_repo-1.0.1-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "52bfd534789925af51820c14851e0d4d9f31b0f2799f0d9879bdd29632a69226",
                "md5": "1170af2b33e8c05261cbaf1438c2cb84",
                "sha256": "3386211b38935beaebf2c77c40d167b69dab62b5deb9c9871106c2bcfbfb2931"
            },
            "downloads": -1,
            "filename": "clone_repo-1.0.1.tar.gz",
            "has_sig": false,
            "md5_digest": "1170af2b33e8c05261cbaf1438c2cb84",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 6174,
            "upload_time": "2025-10-25T17:40:40",
            "upload_time_iso_8601": "2025-10-25T17:40:40.388719Z",
            "url": "https://files.pythonhosted.org/packages/52/bf/d534789925af51820c14851e0d4d9f31b0f2799f0d9879bdd29632a69226/clone_repo-1.0.1.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-25 17:40:40",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "micktwomey",
    "github_project": "clone-repo",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "clone-repo"
}
        
Elapsed time: 4.10154s