본문 바로가기
Internship

Git branch->master, conflict 나는 경우, rebase

by Doromi 2024. 1. 12.
728x90
반응형

git clone ssh~ (깃 주소)

git checkout feature/A

feature/A 에서 작업 하고,

작업 후, 
git add .

git commit --m "커밋 메시지"

git push

이후에, PR 을 만드는 경우 conflict 가 발생한다. 이후, 다시 terminal로 돌아와,

git checkout master

git fetch --all ( history 가져오는 것)

git pull origin master(origin에서 local master브랜치로 받아온다.)

git checkout feature/A

git rebase master

충돌 난 코드를 수정한 후,

git add .

git commit --m "새로운 commit"

git rebase --continue ( 에러나는 경우, git rebase --skip 후, log 를 통해 commit 추가 된 것을 확인)

git push origin feature/A -f

git log ( 이 전에 다른 팀원이 추가한 commit이 추가된 것을 확인)

다시 PR 생성

728x90
반응형

'Internship' 카테고리의 다른 글

Async/Await  (0) 2019.05.04
this  (0) 2019.05.04
var vs let  (0) 2019.05.04
scope와 closures  (0) 2019.05.04
프로미스  (0) 2019.05.04