Skip to content

Commit 98ac87e

Browse files
authored
Update README: improve formatting; fix blog link (#62)
1 parent bf447c8 commit 98ac87e

File tree

1 file changed

+28
-23
lines changed

1 file changed

+28
-23
lines changed

README.md

Lines changed: 28 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -5,27 +5,30 @@
55

66
The tool to import commits from private GitLab to separate repo. Can be used to show your programming activity for another company in GitHub.
77

8-
Check out this informative blog post on how to import GitLab commits at https://www.alexandear.tech/posts/2023-03-08-import-gitlab-commits/ for a practical use case.
8+
Check out this informative blog post for a practical use case on how to import GitLab commits [here](https://alexandear.github.io/posts/2023-03-08-import-gitlab-commits/).
99

10-
# Getting Started
10+
## Getting Started
1111

1212
1. Download and install [Go 1.22](https://go.dev/dl/).
1313
2. Install the program by running the command in a shell:
14-
```shell
15-
go install github.com/alexandear/import-gitlab-commits@latest
16-
```
14+
15+
```shell
16+
go install github.com/alexandear/import-gitlab-commits@latest
17+
```
1718

1819
3. Set environment variables and run `import-gitlab-commits`:
19-
```shell
20-
export GITLAB_BASE_URL=<your_gitlab_server_url>
21-
export GITLAB_TOKEN=<your_gitlab_token>
22-
export COMMITTER_NAME="<Name Surname>"
23-
export COMMITTER_EMAIL=<[email protected]>
2420

25-
$(go env GOPATH)/bin/import-gitlab-commits
26-
```
21+
```shell
22+
export GITLAB_BASE_URL=<your_gitlab_server_url>
23+
export GITLAB_TOKEN=<your_gitlab_token>
24+
export COMMITTER_NAME="<Name Surname>"
25+
export COMMITTER_EMAIL=<[email protected]>
26+
27+
$(go env GOPATH)/bin/import-gitlab-commits
28+
```
2729

2830
where
31+
2932
- `GITLAB_BASE_URL` is a GitLab [instance URL](https://stackoverflow.com/questions/58236175/what-is-a-gitlab-instance-url-and-how-can-i-get-it), e.g. `https://gitlab.com`, `https://gitlab.gnome.org` or any GitLab server;
3033
- `GITLAB_TOKEN` is a personal [access token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#create-a-personal-access-token);
3134
- `COMMITTER_NAME` is your GitHub name with surname, e.g. `John Doe` (can be passed to `git config user.name`);
@@ -36,27 +39,29 @@ where
3639

3740
Contributions before running `import-gitlab-commits`:
3841

39-
<img src="./screenshots/contribs_before.png" width="1000">
42+
<img alt="Screenshot of GitHub contributions before running import-gitlab-commits" src="./screenshots/contribs_before.png" width="1000">
4043

4144
After:
4245

43-
<img src="./screenshots/contribs_after.png" width="1000">
46+
<img alt="Screenshot of GitHub contributions after running import-gitlab-commits with new activity" src="./screenshots/contribs_after.png" width="1000">
4447

45-
# Internals
48+
## Internals
4649

4750
What work the tool does:
48-
* gets current user info by `GITLAB_TOKEN`;
49-
* fetches from `GITLAB_BASE_URL` projects that the current user contributed to;
50-
* for all projects fetches commits where author's email is the current user's email;
51-
* creates new repo `repo.gitlab.yourcompany.com.currentusername` and commits all fetched commits with message
51+
52+
- gets current user info by `GITLAB_TOKEN`;
53+
- fetches from `GITLAB_BASE_URL` projects that the current user contributed to;
54+
- for all projects fetches commits where author's email is the current user's email;
55+
- creates new repo `repo.gitlab.yourcompany.com.currentusername` and commits all fetched commits with message
5256
`Project: GITLAB_PROJECT_ID commit: GITLAB_COMMIT_HASH`, commit date `GITLAB_COMMIT_DATE`, and commit author `COMMITTER_NAME <COMMITTER_EMAIL>`.
5357

5458
To show the changes on GitHub you need to:
55-
* create a new repo `yourcompany-contributions` in GitHub;
56-
* open folder `repo.gitlab.yourcompany.com.currentusername`;
57-
* add remote url `git remote add origin [email protected]:username/yourcompany-contributions.git`;
58-
* push changes.
5959

60+
- create a new repo `yourcompany-contributions` in GitHub;
61+
- open folder `repo.gitlab.yourcompany.com.currentusername`;
62+
- add remote url `git remote add origin [email protected]:username/yourcompany-contributions.git`;
63+
- push changes.
6064

6165
## License
66+
6267
[![FOSSA Status](https://app.fossa.com/api/projects/git%2Bgithub.com%2Falexandear%2Fimport-gitlab-commits.svg?type=large)](https://app.fossa.com/projects/git%2Bgithub.com%2Falexandear%2Fimport-gitlab-commits?ref=badge_large)

0 commit comments

Comments
 (0)