gitlab의 물 주기와 github의 잔디 심기가 각각 따로 되어 있으니 손해보는 느낌이 들었다. gitlab page를 사용하는 블로그 때문에 gitlab을 계속 써야되기 때문에 gitlab page repo를 github로 mirroring하여 물을 주면 잔디도 심어지게 해보려고 한다.


우선, github/hoonti06.gitlab.io repo를 생성했다(hoonti06.github.io라고 지을까 살짝 고민했다).

그다음 https://docs.gitlab.com/ee/user/project/repository/repository_mirroring.html의 'Setting up a push mirror from GitLab to GitHub'에 나와있는대로 github personal access token을 생성했다.


gitlab/hoonti06.gitlab.io repo의 'Settings > Repository' 메뉴에 가서 mirroring repository에 생성한 github/hoonti06.gitlab.io repo의 주소인 https://github.com/hoonti06/hoonti06.gitlab.io.git을 입력하고, password에 위에서 생성했던 github personal access token을 입력했다. Mirror direction은 push로 설정하고 Mirror repository 버튼을 클릭하여 설정을 완료했다.


Update now 버튼을 클릭했더니 다음과 같은 에러가 발생했다.

13:close stream to gitaly-ruby: rpc error: code = Unknown desc = Gitlab::Git::CommandError: remote: No anonymous write access. fatal: Authentication failed for 'https://github.com/hoonti06/hoonti06.gitlab.io.git/'.


이리저리 찾아보다가 어떤 블로그에서 github의 username을 https:// 다음에 붙여줘야 한다는 것을 알게 되었다. Gitlab docs에서도 적혀 있었는데 내가 제대로 확인 못한 탓이었다.


그래서 repo URL을 'https://github.com/hoonti06/hoonti06.gitlab.io.git' 에서 'https://hoonti06@github.com/hoonti06/hoonti06.gitlab.io.git' 으로 변경해주었더니 mirroring에 성공하였다.