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
+28-23Lines changed: 28 additions & 23 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -5,27 +5,30 @@
5
5
6
6
The tool to import commits from private GitLab to separate repo. Can be used to show your programming activity for another company in GitHub.
7
7
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/).
9
9
10
-
# Getting Started
10
+
##Getting Started
11
11
12
12
1. Download and install [Go 1.22](https://go.dev/dl/).
13
13
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
+
```
17
18
18
19
3. Set environment variables and run `import-gitlab-commits`:
- `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;
30
33
- `GITLAB_TOKEN` is a personal [access token](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#create-a-personal-access-token);
31
34
- `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
36
39
37
40
Contributions before running `import-gitlab-commits`:
<img alt="Screenshot of GitHub contributions after running import-gitlab-commits with new activity"src="./screenshots/contribs_after.png" width="1000">
44
47
45
-
# Internals
48
+
## Internals
46
49
47
50
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
52
56
`Project: GITLAB_PROJECT_ID commit: GITLAB_COMMIT_HASH`, commit date `GITLAB_COMMIT_DATE`, and commit author `COMMITTER_NAME <COMMITTER_EMAIL>`.
53
57
54
58
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`;
0 commit comments