git-flow 전략

[git] Git-flow 전략과 프로젝트 예시(feat. Kuring)

프론트엔드 git 협업 순서

  1. git remote -v 이 파일과 연결된 원격 저장소 origin과 upstream 있는지 여부 확인

  2. git branch (현재 있는 branch 위치가 upstream인지 확인)

  3. git checkout -b ‘내 branch명’ (새로운 내 브랜치 만들기)

  4. (코드 수정 이후) git add .

  5. git commit -m ‘commit명’

  6. git push origin ‘내 branch명’

  7. 팀계정 repository에서 fork한 내 github 주소로 들어가기

  8. create pull request 하기

    스크린샷 2022-12-27 오후 8.11.47.png

  9. github 관리자가 merge pull request 할때까지 기다리기

  10. (merge pull request하여 upstream이 업데이트 된 후) 다시 vscode로 돌아가기

  11. vscode 터미널에서 git branch - 내가 지금 있는 branch 위치 확인 후 upstream branch(develop)로 이동하기

    (만약 현재 branch 위치가 upstream branch가 아니라면) git checkout “upstream branch명”

  12. git pull upstream “upstream branch명” 하여 내 fork 최신화하기

  13. ‘나의 develop 브랜치가 origin/develop보다 몇 개 커밋 만큼 앞에 있습니다.’ 가 뜨는 경우

    스크린샷 2022-12-27 오후 8.28.58.png

    git push origin develop 을 입력해서(반드시 develop branch에서!!) origin/develop에 나의 develop push해주면 됨.