728x90
Pull Request를 사용하게 된 이유
1. 코드리뷰
2. 다른사람과 협업하기 위해
3. 바로 머지 되지 않으므로 코드에 좀 더 신경 쓸 수 있음
Pull Request를 보내기 위한 방법
1. base repo를 fork
2. base repo를 clone
3. .git/config 수정
vi .git/config
[remote "upstream"]
url = base repo
fetch = +refs/heads/*:refs/remotes/upstream/*
[remote "origin"]
url = fork repo
fetch = +refs/heads/*:refs/remotes/origin/*
git remote -v
origin forkrepo (fetch)
origin forkrepo (push)
upstream baserepo (fetch)
upstream baserepo (push)
4. Pull Request를 보내기 위한 작업 방식
#base repo의 특정 branch를 받음
git fetch upstream test2021
#받은 특정 branch를 test1의 로컬 브랜치로 설정하고 해당 로컬 브랜치로 checkout
git checkout upstream/test2021 -b test1
파일 수정
#commit에 올릴 파일 or 디렉토리 경로
git add 파일이름
#git add -A (작업 디렉토리 내 모든 변경사항 add)
#git add . (현재 디렉토리 내 모든 변경사항 add)
#commit에 넣을 메세지
git commit -m “커밋메세지"
#로컬의 test1 브랜치를 fork repo에 push
git push origin test1
'ETC' 카테고리의 다른 글
[Linux] url 응답 시간 확인 (0) | 2022.10.14 |
---|---|
[Chorme] Mac에서 크롬 자동 업데이트 끄기 (0) | 2022.10.11 |
[MAC] 개발자를 확인할 수 없기 때문에 열 수 없습니다. (0) | 2021.11.04 |
ElasticSearch (0) | 2021.07.20 |
xcopy 특정 파일, 폴더 제외 (0) | 2019.12.11 |