IT/이론
[Git] Forked Repository가 꼬였을 때... (5 commits ahead of...)
공대생의 차고
2020. 7. 30. 11:20
반응형
현재 작업하던 정보를 보존하면서 커밋 로그가 꼬여버렸을 때 해결법:
# Memorize current work:
git checkout master
git checkout -b mybranch
git remote add upstream /url/original/repo
git fetch upstream
# reset master to upstream/master
git checkout master
git reset --hard upstream/master
git push --force
# replay the patches (even they are rejected for now) on top of master
git checkout mybranch
git rebase master
git push -u origin mybranch
설명이 필요 없을 정도로 간단하다.
반응형