git rebase후 push 에러 해결

개요

내 브랜치에서 메인 브랜치를 찝어서 rebase를 한 뒤 push하면 아래와 같은 에러가 뜰 때가 있다.

rebase Updates were rejected because the tip of your current branch is behind 어쩌구저쩌구

뭐 내 브랜치 가리키는게 뒤에 있어서 샬라샬라 같은 문제인듯 하다.
여기서 pull을 받고 push를 하거나 혹은 commit하면
merge commit이 들어가거나 혹은 rebase해서 받아온 커밋이 복제되어서 두번 반복해서 들어가는 안예쁨이 있다.

해결

git push -f origin

로 포스 푸쉬를 하면 된다.
그럼 깔끔히 rebase된 상태로 서버에 올라간다.

may the force with you.

refer

http://stackoverflow.com/questions/15143042/cant-push-to-branch-after-rebase