https://github.com/<your-username>/<repository-name>.git
git clone https://github.com/<your-username>/<repository-name>.git
cd <repository-name>
Fork한 저장소는 기본적으로 자신의 저장소만 연결되어 있으므로, 원본 저장소를 추가해야 합니다.
1. 원본 저장소를 upstream이라는 이름으로 추가
git remote add upstream https://github.com/<original-owner>/<repository-name>.git
git remote -v
출력
origin https://github.com/<your-username>/<repository-name>.git (fetch)
origin https://github.com/<your-username>/<repository-name>.git (push)
upstream https://github.com/<original-owner>/<repository-name>.git (fetch)
upstream https://github.com/<original-owner>/<repository-name>.git (push)
git checkout -b <branch-name>
feature/add-login
또는 fix/typo-in-readme
.git status
git add <file-name> # 특정 파일만 추가
# 또는 모든 변경 파일 추가
git add .
git commit -m "Add new feature" # 커밋 메시지는 작업 내용을 간결히 설명
git push origin <branch-name>
git add .
git commit -m "Fix requested changes"
git push origin <branch-name>
PR에 수정 사항이 자동으로 반영됩니다
PR이 반영되었거나 원본 저장소가 업데이트되었을 경우, Fork한 저장소와 동기화를 유지하려면 다음 단계를 수행합니다
1. 원본 저장소(upstream)의 변경 내용을 가져옵니다
git fetch upstream
git merge upstream/main
git push origin main
---