hyelie
hyelie
Hyeil Jeong
       
글쓰기    관리    수식입력
  • 전체보기 (495)
    • PS (283)
      • Algorithm (28)
      • PS Log (244)
      • Contest (6)
      • Tips (5)
    • Development (52)
      • Java (14)
      • Spring (23)
      • SQL (2)
      • Node.js (2)
      • Socket.io (3)
      • Study (4)
      • Utils (4)
    • DevOps (36)
      • Git (5)
      • Docker (4)
      • Kubernetes (2)
      • GCP (3)
      • Environment Set Up (8)
      • Tutorial (12)
      • Figma (2)
    • CS (74)
      • OOP (7)
      • OS (24)
      • DB (2)
      • Network (24)
      • Architecture (0)
      • Security (2)
      • Software Design (0)
      • Parallel Computing (15)
    • Project (15)
      • Project N2T (5)
      • Project ASG (0)
      • Project Meerkat (1)
      • Model Checking (7)
      • Ideas (2)
    • 내가 하고싶은 것! (34)
      • Plan (16)
      • Software Maestro (10)
      • 취준 (8)
hELLO · Designed By 정상우.
hyelie

hyelie

[Git] git mirroring 하기
DevOps/Git

[Git] git mirroring 하기

올해 말에 인턴을 생각하고 있어서 지금까지 했던 흩어져 있는 프로젝트를 정리하고 있다.

 

그래서 git 저장소를 미러링 해야 한다. gitlab은 아직 작업 중이고, 과거에 진행했던 팀 프로젝트를 모아야 한다.

 

1. 끝난 프로젝트 mirroring

1) clone --bard 해서 로컬에 가져옴. 명령어는 아래와 같다.

git clone -bare https://......~~~.git (가져올 repository)

 

2) clone한 곳으로 이동한다.

3) git push --mirror로 push. 명령어는 아래와 같다.

git push --mirror https://....~~~.git (새로 저장할 repository)

 

이렇게 하면 완료된 프로젝트의 커밋 기록까지 다 가져온다.

 

 

2. 진행중인 프로젝트 mirroring

나는 gitlab에서 소프트웨어 마에스트로 프로젝트를 계속 진행 중이다. 그래서 commit이 계속 될 것인데 이걸 github로 불러오고 싶다.

 

1) developer token 발급

github settings - develop settings

 

personal access tokens - generate new token

 

expiration 설정, repo 클릭. generate token. token은 유출하면 안 된다!

 

이후 새로운 repository 생성.

 

이후 gitlab - (mirror 하고 싶은 프로젝트) - settings - repository.

git repository url에는 저장되었으면 하는 repository, password는 방금 발급받은 token을 넣으면 된다.

다만,

https://github.com/닉네임/저장소이름.git

대신에

https://닉네임@github.com/닉네임/저장소이름.git

이런 식으로 링크를 붙여 넣어야 한다.

 

이후 돌아가는 화살표를 클릭하면 된다.

'DevOps > Git' 카테고리의 다른 글

[Git] 개발 규칙 정하기 - Kanban과 commit 규칙  (0) 2022.11.01
[Git] git commit template 적용  (0) 2022.10.17
[Git] 현업에서 사용하는 git  (0) 2022.10.04
[Git] 깃랩 gitlab  (0) 2022.10.04
    hyelie
    hyelie

    티스토리툴바