Skip to content

Commit 29f1c59

Browse files
committed
Update README
Fixes #5
1 parent d04d143 commit 29f1c59

File tree

1 file changed

+21
-8
lines changed

1 file changed

+21
-8
lines changed

README.md

Lines changed: 21 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -29,14 +29,22 @@ gitlab-cli label copy -U https://gitlab.com/<USER>/<REPO> -t <TOKEN>
2929

3030
> Tip: To avoid specifying `-U` and `-t` every time you refer to a repository, you can use the config file to save the details of it. See [Specifying a repository](#specifying-a-repository).
3131
32-
#### Copy labels from one repository to another
32+
#### Copy labels from repoA to repoB
3333

3434
```sh
3535
gitlab-cli label copy -r <NAME> <GROUP>/<REPO>
3636
```
3737

3838
> 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).
3939
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+
```
47+
4048
#### Update labels that match a regex
4149

4250
```sh
@@ -113,6 +121,11 @@ But there's no need to manually edit this file. Instead use the config commands
113121

114122
You'll need a [Go dev environment](https://golang.org/doc/install).
115123

124+
```sh
125+
git clone https://github.com/xanzy/go-gitlab
126+
git submodule --init update
127+
```
128+
116129
### Build
117130

118131
```sh
@@ -135,14 +148,14 @@ You can spin up a GitLab instance using [Docker](https://www.docker.com/):
135148
docker pull gitlab/gitlab-ce
136149
docker run -d --name gitlab -p 8055:80 gitlab/gitlab-ce
137150
sleep 60 # allow enough time for GitLab to start
138-
docker exec gitlab \
139-
sudo -u gitlab-psql \
140-
/opt/gitlab/embedded/bin/psql --port 5432 -h /var/opt/gitlab/postgresql -d gitlabhq_production -c " \
141-
INSERT INTO labels (title, color, template) VALUES ('feature', '#000000', true); \
142-
INSERT INTO labels (title, color, template) VALUES ('bug', '#ff0000', true); \
143-
UPDATE users SET authentication_token='secret' WHERE username='root';"
151+
docker exec -ti gitlab bash
152+
su gitlab-psql
153+
/opt/gitlab/embedded/bin/psql --port 5432 -h /var/opt/gitlab/postgresql -d gitlabhq_production -c " \
154+
INSERT INTO labels (title, color, template, description, description_html) VALUES ('feature', '#000000', true, 'represents a feature', 'represents a <b>feature</b>'); \
155+
INSERT INTO labels (title, color, template, description, description_html) VALUES ('bug', '#ff0000', true, 'represents a bug', 'represents a <b>bug</b>'); \
156+
UPDATE users SET authentication_token='secret' WHERE username='root';"
144157
145158
# Note: you may need to change GITLAB_URL to point to your docker container.
146159
# 'http://docker' is for Docker beta for Windows.
147-
GITLAB_URL="http://docker:8055" GITLAB_TOKEN="secret" go test -v ./gitlab
160+
GITLAB_URL="http://localhost:8055" GITLAB_TOKEN="secret" go test -v ./gitlab
148161
```

0 commit comments

Comments
 (0)