Name | pygitmirror JSON |
Version |
0.0.2
JSON |
| download |
home_page | None |
Summary | An executable to clone git repos from one git server to another. |
upload_time | 2024-10-04 01:41:17 |
maintainer | None |
docs_url | None |
author | None |
requires_python | >=3.9 |
license | MIT |
keywords |
git
clone
gitea
github
gitlab
mirror
server
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# Git Mirror
[![PyPi Badge](https://img.shields.io/pypi/v/pygitmirror)](https://pypi.org/project/pygitmirror/)
![Publish](https://github.com/pygitmirror/pygitmirror/workflows/Publish/badge.svg)
![Test](https://github.com/pygitmirror/pygitmirror/workflows/Test/badge.svg)
[![Downloads](https://static.pepy.tech/personalized-badge/pygitmirror?period=week&units=international_system&left_color=black&right_color=orange&left_text=Last%20Week)](https://pepy.tech/project/pygitmirror)
[![Downloads](https://static.pepy.tech/personalized-badge/pygitmirror?period=month&units=international_system&left_color=black&right_color=orange&left_text=Month)](https://pepy.tech/project/pygitmirror)
[![Downloads](https://static.pepy.tech/personalized-badge/pygitmirror?period=total&units=international_system&left_color=black&right_color=orange&left_text=Total)](https://pepy.tech/project/pygitmirror)
`git-mirror` is part of the `pygitmirror` Python package. `git-mirror` is an executable to clone git repos from one git server to another.
## Installation
To install `pygitmirror` into your Python environment:
pip install -U pygitmirror
The package exposes a single executable `git-mirror` which is used to systematically mirror your git repos from one `git` server to another.
## Usage
After installing `pygitmirror`, you can call the `git-mirror` executable to clone/mirror your `git` repository between two git servers:
git-mirror --source_url <source git server URL> --destination_url <destination git server URL> --org <organization or project name> --repo <repo name>
`git-mirror` will use the current directory to check out your source repository and pushes **all branches** in it to its new location at the destination. Note, the destination repository needs to **_already exist_** at the destination server, albeit being empty!
To use a custom sync/temporary path:
git-mirror --sync_path <custom sync path> ..
To mirror multiple repositories at once, you should use the `JSON` file option:
```json
{
"sync_path": "<local path for sync>",
"source_url": "ssh://<source-git-server>:<source port> or https://<source-server>",
"destination_url": "ssh://<destination-git-server> or https://<destination-server>",
"repos": {
// comments are allowed at the beginning
"organization-1": [
// comments are allowed at the beginning
"repo-1",
"repo-2",
"..."
],
"organization-2": ["repo-3", "repo-4", "..."]
}
}
```
Note: `JSON` file entries supersede the other command line arguments.
To get a list of all available parameters:
git-mirror -h
## Development
To clone the library for development:
git clone https://github.com/pygitmirror/pygitmirror.git
or
git clone git@github.com:pygitmirror/pygitmirror.git
### Build The Virtual Environment
The current earliest Python version supported is `3.9`. You need to be able to create a virtual environment at this version to make sure any changes you make is compatible.
If you are using `conda`:
conda create --prefix=.venv python=3.9 --yes
If you are using `venv`, make sure you have the right base package:
>> python --version
Python 3.9.x
Once you verify your base Python, you can then create a virtual environment using:
virtualenv -p py3.9 .venv
### Setup
Once you have created your virtual environment and made sure it is active in your current command line:
python3 -m pip install --upgrade pip
pip install -e .[dev]
This should all the dependencies you need for developing into the library and also allow you to run the unit tests:
pytest
Raw data
{
"_id": null,
"home_page": null,
"name": "pygitmirror",
"maintainer": null,
"docs_url": null,
"requires_python": ">=3.9",
"maintainer_email": "Bassem Girgis <brgirgis@gmail.com>",
"keywords": "git, clone, gitea, github, gitlab, mirror, server",
"author": null,
"author_email": "Bassem Girgis <brgirgis@gmail.com>",
"download_url": "https://files.pythonhosted.org/packages/e4/e5/067dfbb2e26628557322d8ee815e1e8221fead46fda5323ecba502277516/pygitmirror-0.0.2.tar.gz",
"platform": null,
"description": "# Git Mirror\n\n[![PyPi Badge](https://img.shields.io/pypi/v/pygitmirror)](https://pypi.org/project/pygitmirror/)\n![Publish](https://github.com/pygitmirror/pygitmirror/workflows/Publish/badge.svg)\n![Test](https://github.com/pygitmirror/pygitmirror/workflows/Test/badge.svg)\n[![Downloads](https://static.pepy.tech/personalized-badge/pygitmirror?period=week&units=international_system&left_color=black&right_color=orange&left_text=Last%20Week)](https://pepy.tech/project/pygitmirror)\n[![Downloads](https://static.pepy.tech/personalized-badge/pygitmirror?period=month&units=international_system&left_color=black&right_color=orange&left_text=Month)](https://pepy.tech/project/pygitmirror)\n[![Downloads](https://static.pepy.tech/personalized-badge/pygitmirror?period=total&units=international_system&left_color=black&right_color=orange&left_text=Total)](https://pepy.tech/project/pygitmirror)\n\n`git-mirror` is part of the `pygitmirror` Python package. `git-mirror` is an executable to clone git repos from one git server to another.\n\n## Installation\n\nTo install `pygitmirror` into your Python environment:\n\n pip install -U pygitmirror\n\nThe package exposes a single executable `git-mirror` which is used to systematically mirror your git repos from one `git` server to another.\n\n## Usage\n\nAfter installing `pygitmirror`, you can call the `git-mirror` executable to clone/mirror your `git` repository between two git servers:\n\n git-mirror --source_url <source git server URL> --destination_url <destination git server URL> --org <organization or project name> --repo <repo name>\n\n`git-mirror` will use the current directory to check out your source repository and pushes **all branches** in it to its new location at the destination. Note, the destination repository needs to **_already exist_** at the destination server, albeit being empty!\n\nTo use a custom sync/temporary path:\n\n git-mirror --sync_path <custom sync path> ..\n\nTo mirror multiple repositories at once, you should use the `JSON` file option:\n\n```json\n{\n \"sync_path\": \"<local path for sync>\",\n \"source_url\": \"ssh://<source-git-server>:<source port> or https://<source-server>\",\n \"destination_url\": \"ssh://<destination-git-server> or https://<destination-server>\",\n \"repos\": {\n // comments are allowed at the beginning\n \"organization-1\": [\n // comments are allowed at the beginning\n \"repo-1\",\n \"repo-2\",\n \"...\"\n ],\n \"organization-2\": [\"repo-3\", \"repo-4\", \"...\"]\n }\n}\n```\n\nNote: `JSON` file entries supersede the other command line arguments.\n\nTo get a list of all available parameters:\n\n git-mirror -h\n\n## Development\n\nTo clone the library for development:\n\n git clone https://github.com/pygitmirror/pygitmirror.git\n\nor\n\n git clone git@github.com:pygitmirror/pygitmirror.git\n\n### Build The Virtual Environment\n\nThe current earliest Python version supported is `3.9`. You need to be able to create a virtual environment at this version to make sure any changes you make is compatible.\n\nIf you are using `conda`:\n\n conda create --prefix=.venv python=3.9 --yes\n\nIf you are using `venv`, make sure you have the right base package:\n\n >> python --version\n Python 3.9.x\n\nOnce you verify your base Python, you can then create a virtual environment using:\n\n virtualenv -p py3.9 .venv\n\n### Setup\n\nOnce you have created your virtual environment and made sure it is active in your current command line:\n\n python3 -m pip install --upgrade pip\n pip install -e .[dev]\n\nThis should all the dependencies you need for developing into the library and also allow you to run the unit tests:\n\n pytest\n",
"bugtrack_url": null,
"license": "MIT",
"summary": "An executable to clone git repos from one git server to another.",
"version": "0.0.2",
"project_urls": {
"Documentation": "https://github.com/pygitmirror/pygitmirror",
"Homepage": "https://github.com/pygitmirror/pygitmirror",
"Issues": "https://github.com/pygitmirror/pygitmirror/issues",
"Repository": "https://github.com/pygitmirror/pygitmirror.git"
},
"split_keywords": [
"git",
" clone",
" gitea",
" github",
" gitlab",
" mirror",
" server"
],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "6621f2db816fd5d0db4b31885783ae929ff08351282138e1b485ffcb3dd5ad7c",
"md5": "fbce8f9c9f56f44c933daa833733dc6b",
"sha256": "1cfb6a7a4375dba19c6ff8aecc59cfe9c1b9ac739538ea16ba90c7bbebf848aa"
},
"downloads": -1,
"filename": "pygitmirror-0.0.2-py3-none-any.whl",
"has_sig": false,
"md5_digest": "fbce8f9c9f56f44c933daa833733dc6b",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": ">=3.9",
"size": 11081,
"upload_time": "2024-10-04T01:41:15",
"upload_time_iso_8601": "2024-10-04T01:41:15.446929Z",
"url": "https://files.pythonhosted.org/packages/66/21/f2db816fd5d0db4b31885783ae929ff08351282138e1b485ffcb3dd5ad7c/pygitmirror-0.0.2-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "e4e5067dfbb2e26628557322d8ee815e1e8221fead46fda5323ecba502277516",
"md5": "4470d92c7ca9bc6a09dfd4de9a8a03e0",
"sha256": "bb52fb8b102d8573288b3cb1c1f9491a44261ba563d1eeb3e5b6b46d4d055f4a"
},
"downloads": -1,
"filename": "pygitmirror-0.0.2.tar.gz",
"has_sig": false,
"md5_digest": "4470d92c7ca9bc6a09dfd4de9a8a03e0",
"packagetype": "sdist",
"python_version": "source",
"requires_python": ">=3.9",
"size": 19406,
"upload_time": "2024-10-04T01:41:17",
"upload_time_iso_8601": "2024-10-04T01:41:17.000417Z",
"url": "https://files.pythonhosted.org/packages/e4/e5/067dfbb2e26628557322d8ee815e1e8221fead46fda5323ecba502277516/pygitmirror-0.0.2.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2024-10-04 01:41:17",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "pygitmirror",
"github_project": "pygitmirror",
"travis_ci": false,
"coveralls": false,
"github_actions": true,
"lcname": "pygitmirror"
}