728x90
반응형
1. Github에서 Repository 생성하고 Clone 받기
$ git clone <github 주소>
$ git remote -v
origin <github repo> (fetch)
origin <github repo> (push)
2. Branch 생성하기
- Gitlab에 있는 모든 branch 를 생성해준다.
- 꼭 처음에 만들어줘야 history 문제를 겪지 않는다.
$ git branch dev
$ git push origin dev
$ git branch etc
$ git push origin etc
$ git branch docs
$ git push origin docs
3. Gitlab 저장소 upstream 이름으로 Remote 추가
- Gitlab 주소를 ssh형식이 아닌 http 형식으로 remote 받아야한다.
$ git remote add upstream <gitlab 주소>
$ git remote -v
origin <github repo> (fetch)
origin <github repo> (push)
upstream <gitlab repo> (fetch)
upstream <gitlab repo> (push)
4. 특정 브랜치의 Gitlab remote 불러오기
- 앞서 만든 branch 로 checkout 하고, 해당 Gitlab branch 를 pull 받는다
$ git checkout <branch>
$ git pull upstream <branch>
$ git branch -al
* <branch>
remotes/upstream/<branch>
5. Gitlab으로 push하기
$ git push origin <branch> --allow-unrelated-histories
$ git branch -al
* master
remotes/origin/master
remotes/upstream/master
6. 모든 branch에 대해 fork 진행
4,5번을 반복 수행한다.
728x90
반응형
'IT 지식' 카테고리의 다른 글
[자료형] 자료형 크기와 범위 / int와 long 차이점 (0) | 2023.01.05 |
---|---|
[MobaXterm] An application on remote computer has requested access to the X server (0) | 2022.04.04 |
[Node] 서버와 연동된 VSCode에 Node.js 설치하기 (Node.js 낮은 버전으로 설치되는 문제 해결) (0) | 2022.02.21 |
[git] 가장 최근의 커밋 메세지 수정하기 (0) | 2021.12.05 |
[VSCode] 저장할 때 자동정렬되도록 설정하기 (0) | 2021.09.29 |