[git] 에러 모음

윤경·2022년 1월 19일


  • error: you need to resolve your current index first
    : 나의 경우 merge가 필요한 상황이었음
    ➡️ git reset --merge
  • master → main 바꾸고 싶을 때
    ➡️ git checkout master
  • 아래와 같은 에러가 발생했을 때 강제로 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 push origin +main 또는 git push origin main -f
➡️ 아니면 다른 분들처럼 clone해놓고 다시 하는 방법도 있다. 🔗게시글, 🔗게시글 참조 (둘 중 하나 참고)

  • Automatic merge failed; fix conflicts and then commit the result.
    : pull request가 충돌되어 automatically merge가 안되는 상황

➡️ 1. 깃허브에서 close pull request
2. 깃허브에서 delete branch for pull request
3. 나의 경우 터미널에서 다시 git add .부터 실행시켰다.
그 이외의 경우 해당 🔗블로그를 참고하자.

  • 에러 메시지: fatal: Not possible to fast-forward, aborting.
  • 해결: git pull origin main --rebase

에러 발생시마다 계속 추가중

profile
개발 바보 이사 중

0개의 댓글