과제 제출 위해 원격 저장소에 푸시 시도 중입니다. 로컬과 원격 저장소 내용이 달라 충돌 발생한 것 같습니다.
코드:
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 발생해서 중단함.
질문: 기존 원격 내용을 무시하고 현재 로컬 상태로 강제 덮어쓰기 하려면 어떻게 해야 합니까?
댓글3
모든 이야기1456
가벼운 안부부터 깊은 생각까지, 함께 나눠요.
총 1456개의 이야기
그냥 git push -f 쓰면 바로 덮어씌워짐.
과제 제출이면 이게 제일 편하긴 함ㅋㅋ
대신 원격에 있던 거 다 날아가니까 조심하세요.