2. Git 협업 (Fork / upstream 등록)

2021. 8. 23. 17:59git

만약 Private Repository 라면 Contributors 권한이 있어야 한다. 

 

* Contributors 권한 생성 참고 *https://crispypotato.tistory.com/123

 

1. Git 협업 (Contributors 추가방법)

협업 시 개발하는 해당 레포지토리에 초대 해야한다. Settings - Manage access 에 이동하여 Invite a collaborator 버튼을 눌러 초대하는 사람의 이름이나 이메일을 검색해 초대장을 보낸다. 초대 유저의 이

crispypotato.tistory.com

 

 

1. Fork 방법

해당 Repository 상단 오른쪽에 보면 fork 버튼이있다.

* Fork : (다른 개발자) Repository를 가져와 본인의 Repository에 복사하여 가져온다. 

fork 버튼

Fork를 했다면 본인의 Repository에서 clone하여 본인의 로컬에 저장을 한다.

git clone ( 복사한 본인의 Repository clone 주소)

 

2. upstream 등록

* origin : 본인의 Repository 에 git 주소

* upstream : (다른 개발자) Repository에서 복사 했던  git 주소

 

remote 검색 명령어 :

git remote -v

remote를 검색하면 

git remote -v
origin  https://github.com/wls0/****.git (fetch)
origin  https://github.com/wls0/****.git (push)

clone을 하면 본인의 Repository git 주소가 설정되어있다. 

 

upstream 등록 명령어 : 

git remote add upstream (다른 개발자(원본)Repository git 주소)

 

명령어를 넣어 준 후 remote 검색을 하면

git remote -v
origin  https://github.com/wls0/****.git (fetch)
origin  https://github.com/wls0/****.git (push)
upstream        https://github.com/다른개발자/다른개발자 Repository 이름.git (fetch)
upstream        https://github.com/다른개발자/다른개발자 Repository 이름.git (push)

이렇게 remote가 저장된다. 

 

* 주소가 제대로 저장 됐는지 꼭 확인 

 

 

 

 

 

 

728x90
반응형