티스토리 뷰

git push origin main

To https://github.com/xoxowo/HYJ_Board.git
 ! [rejected]        main -> main (non-fast-forward)
error: failed to push some refs to 'https://github.com/xoxowo/HYJ_Board.git'
hint: Updates were rejected because a pushed branch tip is behind its remote
hint: counterpart. Check out this branch and integrate the remote changes
hint: (e.g. 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

 

 내 경우엔 A 브랜치에서 작업을 하고 A 브랜치가 아닌 다른 브랜치에 git push 했을 때 발생

 

📌 해당 오류의 경우 다양한 상황에서 발생하는 오류이기 때문에 각 상황에 따라 해결해야한다.

      원인에 기재했듯 push 할 브랜치명을 작업중인 A 브랜치로 변경해주었더니 정상적으로 해결됐다.

댓글