2022.04.01

Fork

fork란 github repository 를 통째로 복사해서 나의 repo 로 만드는 행위
fork를 한 저장소는 원본과 연결되어 있다
변경 사항을 원본 레포지토리에 적용하고 싶으면 원본 저장소에 pull request를 보내야 한다
pull request 하기 전까지는 내 github에 있는 forkgks repo에만 변경사항이 적용된다

Fork 하는방법

1. 원본 repo를 내 저장소로 fork 하기
2. fork를 해서 복제된 <url> 복사
3. git clone <url>
4. cd <newfile>
5. git branch
6. git flow init 
    ls로 확인해 보면 파일 확인 가능
7. git flow feature start <branch>
8. git flow feature finish <branch>
9. git push -u origin develop

fetch 하는방법

# 원본 repo인 경우에는 git pull origin develop
1. git remote -v
2. git remote add upstream <원본 url>
3. git remote -v
    # upstream 이 생긴걸 볼 수 있다
4. git fetch upstream develop
    # fectch를 해서 반영하는게 아니라 FETCH_HEAD 라는 임시 branch에 담아놓게 된다
5. git merge FETCH_HEAD

'프론트엔드 > Git&GitHub' 카테고리의 다른 글

Git remote  (0) 2022.07.11
Git 명령어 (추가)  (0) 2022.04.04
.gitignore  (0) 2022.04.03
Git Branch와 Git Flow  (0) 2022.04.02
Git clone과 Git init  (0) 2022.04.01

+ Recent posts