CLI tool to clone repos easily
Project description
clone-repo: Easily clone repos
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 using pipx install clone-repo to make it available as a CLI tool everywhere.
Supports:
/path/to/repogit cloneto~/src/localhost/file/{repo}
file:///path/to/repogit cloneto~/src/localhost/file/{repo}
git@example.com:org/repo.gitgit cloneto~/src/{host}/{org}/{repo}
https://github.com/org/repo.gitgit cloneto~/src/github.com/{org}/{repo}
https://github.com/org/repogit cloneto~/src/github.com/{org}/{repo}
https://gitlab.example.com/org/repo.gitgit cloneto~/src/{host}/{org}/{repo}
https://hg.mozilla.org/mozilla-central/hg cloneto~/src/hg.mozilla.org/{org}/{repo}
https://hg.sr.ht/~org/repohg cloneto~/src/hg.sr.ht/{org}/{repo}
keybase://team/org/repogit cloneto~/src/keybase/{org}/{repo}
man@man.sr.ht:~org/repogit cloneto~/src/man.sr.ht/{org}/{repo}
ssh://git@example.com:7999/somegroup/myrepo.gitgit cloneto~/src/{host}/{org}/{repo}
ssh://hg@bitbucket.org/org/repohg cloneto~/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 and pytest:
poetry installpytest -vv
If you want to test across all supported Python versions you can install them via asdf and then use nox:
asdf installpoetry installnox
If you want to run pre-commit hooks before committing:
poetry installpre-commit install
Finally, there is a just justfile to run some commands.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file clone_repo-1.0.1.tar.gz.
File metadata
- Download URL: clone_repo-1.0.1.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.13.8 Darwin/22.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3386211b38935beaebf2c77c40d167b69dab62b5deb9c9871106c2bcfbfb2931
|
|
| MD5 |
1170af2b33e8c05261cbaf1438c2cb84
|
|
| BLAKE2b-256 |
52bfd534789925af51820c14851e0d4d9f31b0f2799f0d9879bdd29632a69226
|
File details
Details for the file clone_repo-1.0.1-py3-none-any.whl.
File metadata
- Download URL: clone_repo-1.0.1-py3-none-any.whl
- Upload date:
- Size: 6.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/2.2.1 CPython/3.13.8 Darwin/22.6.0
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
bf3851de97bea717fca0383c46fb00c93e55e3473db26811fbd3636dbe011d20
|
|
| MD5 |
0f629778fa077f9c0446ffb2884c73b0
|
|
| BLAKE2b-256 |
ec9dd03812ee35c790e31496e9afe0f7a34d66bf54a97f1724c2cfa1134305b5
|