본문 바로가기
🛠️DevTools/Git

[Git] Fork. Repository변경사항 업데이트

by inbeom 2023. 8. 27.
728x90

💡 fork

  • fork는 다른 사람의 Github repository에서 내가 어떤 부분을 수정하거나 추가 기능을 넣고 싶을 때 해당 respository를 내 Github repository로 그대로 복제하는 기능이다.
  • 저장소는 원본(다른 사람의 github repository)와 연결되어 있다.
  • original repository에 어떤 변화가 생기면(새로운 commit 또는 branch) 이는 그대로 forked된 repository로 반영할 수 있다.
  • 이 때 fetch나 rebase의 과정이 필요하다.

 

Git Bash

$ git init
$ git remote -v

$ git remote add upstream [Original저장소 주소]
$ git remote -v
$ git remote update

$ git checkout master
$ git fetch upstream

 

명령어가 제대로 동작하지 않는다면

  1. 깃허브에서 fork한 내 repository에 접속
  2. branches 클릭
  3. 우측 상단 ‘New branch’버튼 클릭
  4. Branch source에서 저장소 위치를 내께 아닌 OriginalRepository로 변경
  5. OriginalRepository의 원하는 branch선택 후 name 입력하여 Create 하면 된다.
728x90

'🛠️DevTools > Git' 카테고리의 다른 글

[Git] .gitignore 사용법  (0) 2023.08.27
[Git] Git 명령어  (0) 2023.08.27
[Git] Git과 Github의 차이  (0) 2023.08.27
[Git] Git이란?  (0) 2023.08.27
[Git] 에러노트  (0) 2023.08.27