반응형
! [rejected] main -> main (non-fast-forward)error: failed to push some refs to 'https://github.com/sungchanyoung/security.git'hint: Updates were rejected because the tip of your current branch is behindhint: its remote counterpart. If you want to integrate the remote changes,hint: use 'git pull' before pushing again.hint: See the 'Note about fast-forwards' in 'git push --help' for details
(fast-forward) : fast-foward는 merge방식 하나이다. => 현재 브랜치의 HEAD가 대상 브랜치의 HEAD 까지 옮기는 merge이다.
behindhint : behind(뒤) hint 힌트 => 백엔드
integrate: 통합하다
counterpart :정부, 부분
remote : 멀리 떨어지
=> 결과적으로 이 메세지는 main브랜치가 현재 로컬 브랜치보다 더 최신 상태이기 때문에 push가 거부되었다는 메시지
해결 방법
//main브랜치를 동기화 시켜주는 작업
git pull origin main(master) --rebase
최신 변경 사항을 가져오면서 내 변경 사항을 최신 커밋으로 올림
//동기화를 마치고 다시 푸쉬해서 최신 상태를 다시 업데이트
git push origin main(master)
git push 안될 경우 --force를 main옆에 작성하면 된다.
--force 강제로
반응형
'git' 카테고리의 다른 글
git 실행원리 (1) | 2025.02.08 |
---|---|
git 협업을 위한 Organization 만들기 (3) | 2024.10.09 |
git 에러 (Push error)- On branch main nothing to commit, working tree clean (0) | 2024.09.15 |