git push 오류


commit 까지 완료하고 이제 github에 push 하려고 하는데 아래와 같은 오류가 뜬다.

hint: Updates were rejected because the tip of your current branch is behind hint: its remote counterpart. Integrate the remote changes (e.g. hint: 'git pull ...') before pushing again. hint: See the 'Note about fast-forwards' in 'git push --help' for details.

git remote repository에 필요없는 파일이 올라가서 삭제했더니 생긴 문제다.

문제가 생긴 원인은 이미 푸시해놓은 파일이 있어서라던가 데이터 유실 등 문제가 잇을 수 있는 부분이 있어서 git에서 처리 되지 않도록 에러를 띄우는 것이다.

해결


git push origin main --force (강제로 합치면 된다… , 대신 데이터 유실 등의 문제가 있을 수 있다.)