You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+34-7Lines changed: 34 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,16 +1,18 @@
1
1
# clonetool
2
2
3
-
`clonetool` is a command-line utility written in Rust designed to clone all repositories for specified GitHub users or organizations. It's a handy tool for quickly backing up or mirroring all of someone's repositories.
3
+
`clonetool` is a command-line utility written in Rust designed to clone all repositories for specified GitHub or GitLab users or organizations. It's a handy tool for quickly backing up or mirroring all of someone's repositories.
4
4
5
5
## Features
6
6
7
-
* Clones all repositories for specified GitHub users or organizations.
7
+
* Clones all repositories for specified GitHub or GitLab users or organizations.
8
8
* Clones repositories into separate folders named after the user/organization in a specified destination directory.
9
9
* Uses `git clone --mirror` to create bare mirror repositories.
10
10
* Provides a `--debug` flag for command output and more verbose messages.
11
11
* Prompts the user before removing existing local directories with the same name as the repos to clone.
12
12
* Allows automated "yes" responses for directory removal with the `--yes` or `-y` flag.
13
13
* Allows automated "no" responses for directory removal with the `--no` or `-n` flag.
14
+
* Allows excluding specific packages using the `--exclude` or `-x` flag.
15
+
* Allows selecting between GitHub or GitLab using the `--provider` flag.
14
16
15
17
## How to Use
16
18
@@ -39,22 +41,24 @@ The basic usage of `clonetool` is:
*`-y, --yes`: Automatically removes existing local directories without prompting.
46
48
*`-n, --no`: Automatically skips cloning if a local directory exists.
49
+
*`-x, --exclude <packages>`: Comma-separated list of packages to exclude, in the form of `user/package`.
50
+
*`--provider <provider>`: The provider to use: `github` or `gitlab`. Default is `github`.
47
51
48
52
### Examples
49
53
50
-
1. **Clone all repositories for a user to the `/home/user/repos` directory:**
54
+
1. **Clone all repositories for a user from GitHub to the `/home/user/repos` directory:**
51
55
52
56
```bash
53
57
clonetool -u testuser -d /home/user/repos
54
58
```
55
59
This will create a directory called `testuser` inside the `repos` directory and all the repos inside that directory will be cloned into separate folders.
56
60
57
-
2. **Clone all repositories for multiple users to the `/mnt/data/github` directory:**
61
+
2. **Clone all repositories for multiple users from GitHub to the `/mnt/data/github` directory:**
This will create a directory called `testuser1`, `testuser2` and `testorg` inside the `github` directory and all the repos inside each user/org directory will be cloned into separate folders.
106
+
82
107
### Note
83
108
84
109
* The tool uses `git clone --mirror` so, while all branches are cloned, it does not clone a standard working directory.
85
110
* There is unfortunately no way to pull changes in a bare repo for all branches at once. As a workaround, you can clone the repos again. The program will prompt you to remove existing local folders so you can clone the latest version.
86
-
* If a user or organization deletes a repository, `clonetool` will not ask to remove that repository because it no longer gets the path from the GitHub API.
111
+
* If a user or organization deletes a repository, `clonetool` will not ask to remove that repository because it no longer gets the path from the GitHub or GitLab API.
87
112
* The program will create the specified destination directory if it does not exist.
88
113
* The program will create separate directories inside the destination, with each directory named after the user/org provided.
89
114
* Usernames/organization names must only contain alphanumeric characters, underscores, or hyphens.
115
+
* Destination directories do not have to be absolute paths.
90
116
91
117
## License
92
118
93
119
This project is open source and available under the [MIT License](LICENSE). The full text of the license can be found in the `LICENSE` file.
94
120
95
121
## Acknowledgment
96
-
This tool was created with the assistance of Google Gemini 2.0 Flash.
122
+
123
+
This tool was created with the assistance of Google Gemini 2.0 Flash.
0 commit comments