본문으로 바로가기
COMMUNITY모든 이야기

git push 시 rejected - non-fast-forward 에러 해결 방법

빗방울 2026.10.30 19:18 1분 읽기 조회 4

과제 제출 위해 원격 저장소에 푸시 시도 중입니다. 로컬과 원격 저장소 내용이 달라 충돌 발생한 것 같습니다.

코드:

git add .
git commit -m "complete assignment"
git push origin main

오류: [rejected] main -> main (fetch first)

error: failed to push some refs to 'https://github.com/user/repo.git'

hint: Updates were rejected because the remote contains work that you do not have locally.

시도: git pull 시도했으나 conflict 발생해서 중단함.

질문: 기존 원격 내용을 무시하고 현재 로컬 상태로 강제 덮어쓰기 하려면 어떻게 해야 합니까?

모든 이야기1456

가벼운 안부부터 깊은 생각까지, 함께 나눠요.

글쓰기
총 1456개의 이야기
댓글