Skip to content

Commit 1f56c18

Browse files
committed
Add post about GitLab -> GitHub migration
Closes #55
1 parent 0d398df commit 1f56c18

2 files changed

Lines changed: 46 additions & 0 deletions

File tree

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
---
2+
title: GitLab to GitHub Migration Guide
3+
sub_title: Import your course projects to GitHub
4+
5+
author:
6+
name: SKIP
7+
---
8+
9+
![](/assets/posts/gitlab-github)
10+
11+
This guide explains two ways to move your projects from Chalmers GitLab to
12+
GitHub while preserving the `git` history.
13+
14+
## Method 1: Move Code with Full Commit History
15+
16+
1. Clone with full history:
17+
```sh
18+
git clone --mirror git@git.chalmers.se:you/your-project.git
19+
```
20+
2. Create an empty GitHub repo.
21+
22+
3. Push mirrored repo:
23+
```sh
24+
cd your-project
25+
git remote set-url git@github.com:yourname/your-project.git
26+
git push --mirror
27+
```
28+
29+
## Method 2: GitHub Import
30+
31+
GitHub has a built-in GitLab Importer, but you will need a GitLab Access Token.
32+
33+
**1. Create a Personal Access Token in GitLab**
34+
35+
* Go to: Chalmers GitLab \> User Settings \> Personal Access Tokens
36+
* Create token with scopes:
37+
* `api`
38+
* `read_repository`
39+
40+
Copy it.
41+
42+
**2. Use GitHub’s GitLab Import Tool**
43+
44+
Go to: [https://github.com/new/import](https://github.com/new/import)
45+
46+
Enter your GitLab repository URL, username, and token.

assets/posts/gitlab-github.png

225 KB
Loading

0 commit comments

Comments
 (0)