Merge하려고 하는데
This branch is out-of-date with the base branch
가 뜬다.
dev에 merge할 feature 브랜치에 원격 저장소의 최신사항이 반영되도록 해야한다.
git checkout dev
feature 브랜치를 merge할 브랜치 dev로 이동
git fetch -p origin
fetch는 원격 저장소에서 branch들과 commit들을 가져온다.
-p는 --prune 옵션이고, 원격 저장소에서 더이상 존재하지 않는 것들을 삭제한다.
git merge origin/dev
원격 저장소의 브랜치 origin/dev의 변경사항을 로컬 dev 브랜치에 merge한다. origin/dev ➡️ dev
git checkout {feature-branch}
feature-branch로 체크아웃한다. ex) git checkout feature/#1
git merge dev
dev ➡️ feature브랜치
git push origin {feature-branch}
feature브랜치에 push한다. ex) git push origin feature/#1
push하기 전에 자동으로 생성되는 merge 커밋을 수정해도 된다.
참고 👇👇
https://gist.github.com/whoisryosuke/36b3b41e738394170b9a7c230665e6b9
Bring your feature branch up to date with master. Deploying from Git branches adds flexibility. Bring your branch up to date wit
Bring your feature branch up to date with master. Deploying from Git branches adds flexibility. Bring your branch up to date with master and deploy it to make sure everything works. If everything l...
gist.github.com
'git' 카테고리의 다른 글
[git] 다른 브랜치에 커밋을 잘못 올렸을 때 (0) | 2023.11.14 |
---|---|
error: failed to push some refs to ~ (0) | 2023.06.25 |
Github Actions를 이용한 CI/CD (0) | 2023.04.26 |
remote: Write access to repository not granted. (0) | 2023.04.26 |
yml 파일 관리 (0) | 2023.04.24 |