minishell - git 협업

YP J·2022년 4월 26일
0

참고
깃브랜치,우아한 애자일 - 전순구

깃 공식홈페이지 설명 - 브랜치란 무엇인가

git merge conflict - fast-forward와 3-way-merge

Git 무료 강좌 2-5. git flow 전략

생활코딩 - Pull request

  1. git repository 하나 생성
    <minishell repository (master zhy2on)>

  2. master branch에 README.md 파일 하나 만들고, git add -> commit -> push  한다

master > git add README.md
master > git commit -m "init"
master > git push origin master
  1. master branch 에서 temp, junyopar, jihoh 이라는 branch 를 만든다.
master > git branch temp
master > git branch junyopar
master > git branch jihoh
  1. branch 생성후 branch 로 이동후 push 해주는 작업 을 꼭해야한다.
master > git checkout temp
temp > git push origin temp
master > git checkout junyopar(jihoh)
junyopar(jihoh) > git push origin junyopar(jihoh)
  1. 각각 작업 하다가 어느정도 기능이 완성되고 각자의 branch 에서 push 해준다.
junyopar(jihoh) > ...working...
junyopar(jihoh) > git add .
junyopar(jihoh) > git commit -m"junyopar(jihoh) 1"
junyopar(jihoh) > git push origin junyopar(jihoh) 
  1. 각자의 작업을 temp branch 에 합칠때 temp branch 로 이동해서 junyopar ,jihoh branch 를 merge 한다.
junyopar > git checkout temp
temp > git merge junyopar
jihoh > git checkout temp
temp > git merge jihoh
  1. temp branch 에서 충돌(conflict)가 발생한다면 junyopar , jihoh 은 충돌된 부분 수정하고(각각 branch에 push 한다음), temp branch 에 add -> commit -> push 한다.
temp > git add . 
temp > git commit -m"jihoh + junyopar merge"
temp > git push origin temp
  1. 충돌이 해결되고 정상적으로 push 했다면 일반적으로 merge 한 branch 는 삭제한다.
temp > git branch -D junyopar
temp > git branch -D jihoh
  1. temp branch 에 이제 오류 없이 정상 작동되는 파일만 있다면
    이제 master branch 로 이동해서 temp branch 를 merge 한다.
temp > git checkout master
master > git merge temp
  1. master branch 에서 충돌 발생하면 ( master 와 temp의 충돌? ) 충돌 된 부분을 수정하고 master branch 에 add -> commit -> push 한다.
master > git add .
master > git commit -m"temp merge"
master > git push origin master 
  1. 충돌 해결 되고 정상적으로 push 했다면 일반적으로 merge 한 branch 는 삭제 한다.
master > git branch -D temp
  1. master branch 에 다 합쳐 졌다면 다시 3번으로 돌아가 현재 master 위치에 새로운 temp, junyopar, jihoh branch 만들고 작업 하면 된다.
master > git branch temp
master > git checkout temp
temp > git push origin temp
master > git branch junyopar(jihoh)
master > git checkout junyopar(jihoh)
junyopar(jihoh) > git push origin junyopar(jihoh)
profile
be pro

0개의 댓글