This tool imports commits from a private GitLab repository to a separate repository.
It can be used to showcase your programming activity for another company on GitHub.
Check out this informative blog post for a practical use case on how to import GitLab commits
here.
Why It's Useful
Contributions before running import-gitlab-commits:
COMMITTER_NAME is your GitHub name with surname, e.g., John Doe (can be passed to git config user.name).
COMMITTER_EMAIL is your GitHub email, e.g., john.doe@example.com (valid for git config user.email).
$(go env GOPATH)/bin/ is the path where import-gitlab-commits is installed.
Internals
What the tool does:
Retrieves current user info using GITLAB_TOKEN.
Fetches projects from GITLAB_BASE_URL that the current user contributed to.
For all projects, fetches commits where the author's email matches the current user's email.
Creates a new repository repo.gitlab.yourcompany.com.currentusername and commits all fetched commits with the message:
Project: GITLAB_PROJECT_ID commit: GITLAB_COMMIT_HASH, commit date GITLAB_COMMIT_DATE, and commit author COMMITTER_NAME <COMMITTER_EMAIL>.
To display the changes on GitHub, you need to:
Create a new repository yourcompany-contributions on GitHub.
Open the folder repo.gitlab.yourcompany.com.currentusername.
Add the remote URL: git remote add origin git@github.com:username/yourcompany-contributions.git.
Package app provides the core functionality for the import-gitlab-commits application, including initializing the GitLab client, fetching user information, and importing commits into a local git repository.
Package app provides the core functionality for the import-gitlab-commits application, including initializing the GitLab client, fetching user information, and importing commits into a local git repository.