[git] git branch 마이그

정리맨·2025년 9월 6일

🔧 단계별 실행

원격 최신 반영 받기

git fetch origin

main 브랜치로 이동

git checkout main

main을 dev와 동일하게 덮어쓰기

git reset --hard origin/dev

원격 main 브랜치 덮어쓰기 (주의: 기존 main 이력 사라짐)

git push origin main --force


main 의 경우에는 protected 된 경우 조치 해주어야함

GitLab → 프로젝트 → Settings > Repository > Protected branches

main이 보호(Protected) 상태라면 → Unprotect 하거나, Force Push 허용 옵션 체크


이관 후 태그 정리(삭제)

git tag -l | xargs -n 1 git push --delete origin

profile
ㅎㅎ

0개의 댓글