clone-repo


Nameclone-repo JSON
Version 0.3.0 PyPI version JSON
download
home_pagehttps://github.com/micktwomey/clone-repo
SummaryCLI tool to clone repos easily
upload_time2023-08-18 08:13:49
maintainer
docs_urlNone
authorMichael Twomey
requires_python>=3.7,<4.0
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": "",
    "docs_url": null,
    "requires_python": ">=3.7,<4.0",
    "maintainer_email": "",
    "keywords": "",
    "author": "Michael Twomey",
    "author_email": "mick@twomeylee.name",
    "download_url": "https://files.pythonhosted.org/packages/08/06/7377a1ceae5187f579d5e50c70332a80ea77dda5a458b0469defc56198a5/clone_repo-0.3.0.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": "0.3.0",
    "project_urls": {
        "Homepage": "https://github.com/micktwomey/clone-repo",
        "Repository": "https://github.com/micktwomey/clone-repo"
    },
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "62d3917011fec331cbdb5caf2b8ff0e466d2ceba0c232d9e4aac11d9f5e5d352",
                "md5": "28bca179fae8e3fe0c2fe6e6900f4ebf",
                "sha256": "efdadd7477b561f2b2fa5c7edd8f7e2c4f2ffd5324c1e6744b2b78ee3ae36dd4"
            },
            "downloads": -1,
            "filename": "clone_repo-0.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "28bca179fae8e3fe0c2fe6e6900f4ebf",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.7,<4.0",
            "size": 7905,
            "upload_time": "2023-08-18T08:13:47",
            "upload_time_iso_8601": "2023-08-18T08:13:47.653078Z",
            "url": "https://files.pythonhosted.org/packages/62/d3/917011fec331cbdb5caf2b8ff0e466d2ceba0c232d9e4aac11d9f5e5d352/clone_repo-0.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "08067377a1ceae5187f579d5e50c70332a80ea77dda5a458b0469defc56198a5",
                "md5": "3cc8c88356061273f4c51925b637842d",
                "sha256": "4f6eb7de9e7dcc35241b94b36fb431dc046eb288592bcfeb0f0182e363a3e9f9"
            },
            "downloads": -1,
            "filename": "clone_repo-0.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "3cc8c88356061273f4c51925b637842d",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.7,<4.0",
            "size": 6367,
            "upload_time": "2023-08-18T08:13:49",
            "upload_time_iso_8601": "2023-08-18T08:13:49.198088Z",
            "url": "https://files.pythonhosted.org/packages/08/06/7377a1ceae5187f579d5e50c70332a80ea77dda5a458b0469defc56198a5/clone_repo-0.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2023-08-18 08:13:49",
    "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: 0.11701s