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
CLI commands for performing actions against GitLab repositories. The main reasons for building this tool is to be able to use it without any prerequisites and to deal with global labels, which GitLab API doesn't expose.
3
+
CLI commands for performing actions against GitLab repositories.
4
4
5
5
-[Installation](#installation)
6
6
-[Usage](#usage)
7
7
-[Labels](#labels)
8
+
-[Copy global labels](#copy-global-labels-into-a-repository)
9
+
-[Copy labels from repoA to repoB](#copy-labels-from-repoa-to-repob)
> Tip: The above command copies labels between repositories on the same GitLab instance. To copy from/to a different GitLab instance, use the config file as explained in [Specifying a repository](#specifying-a-repository).
39
-
40
-
##### Example
41
-
42
-
If both repositories are added to the [config file](#specifying-a-repository) as `repoA` and `repoB`, you can copy labels from repoA to repoB as follows:
43
-
44
-
```sh
45
-
gitlab-cli label copy -r repoB repoA
46
-
```
42
+
> Tip: For repositories on the same installation, you can specify the `--from` repo as `group/repo`, as a convenience, in which case the repository is considered on the same GitLab instance as the target repo.
> Note: `<REGEX>` is a Go regex string as in <https://golang.org/pkg/regexp/syntax> and `<REPLACE>` is a replacement string as in <https://golang.org/pkg/regexp/#Regexp.FindAllString>.
50
+
> Note: `<REGEX>` is a Go regex string as in <https://golang.org/pkg/regexp/syntax> and `<NAME>` is a replacement string as in <https://golang.org/pkg/regexp/#Regexp.FindAllString>.
55
51
56
52
#### Delete labels that match a regex
57
53
58
54
```sh
59
-
gitlab-cli label update -r <NAME> --regex<REGEX>
55
+
gitlab-cli label delete -r <NAME> --match<REGEX>
60
56
```
61
57
62
58
### TODO
@@ -72,19 +68,19 @@ There are 2 ways to specify a repository:
is the same as this, but the repo gets saved in the config file and we can refer to it later by its name:
77
+
you can first save the repo in the config file and refer to it by name on all subsequent commands:
80
78
81
79
```sh
82
80
gitlab-cli config repo save -r myrepo -U https://git.my-site.com/my_group/my_repo -t ghs93hska
83
81
gitlab-cli label copy -r myrepo
84
82
```
85
83
86
-
> Note: Some commands like [`label copy`](#copy-labels-from-one-repository-to-another) allow you to specify a repository by its path (e.g. `my_group/my_repo`), in which case the repository is considered on the same GitLab instance as the target repo.
87
-
88
84
#### Using user and password instead of token
89
85
90
86
You can specify your GitLab login (user or email) - `--user (-u)` - and password - `--password (-p)` - instead of the token in any command, if this is easier for you. Example:
0 commit comments