728x90
반응형
! [rejected] main -> main (non-fast-forward)
error: failed to push some refs to 'https://github.com/~~~.git'
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.
위와 같은 에러 메세지가 떴을 때 해결방법 (다른 pc에서 업로드할 때 유독 자주 나는 에러)
$ git pull origin main --rebase
From https://github.com/~~/~~.git
* branch main -> FETCH_HEAD
Successfully rebased and updated refs/heads/main.
git pull origin [branch] --rebase 다음과 같이 입력합니다. (제가 쓰는 branch이름이 main이라 main으로 입력했습니다.)
$ git push -u origin main
Enumerating objects: 70, done.
Counting objects: 100% (70/70), done.
Delta compression using up to 8 threads
Compressing objects: 100% (68/68), done.
Writing objects: 100% (69/69), 514.79 KiB | 5.15 MiB/s, done.
Total 69 (delta 9), reused 0 (delta 0), pack-reused 0
remote: Resolving deltas: 100% (9/9), done.
To https://github.com/~/~.git
25b3843..5b3497f main -> main
Branch 'main' set up to track remote branch 'main' from 'origin'.
문제 없이 push가 됐습니다.
반응형
'포스트잇' 카테고리의 다른 글
[환경설정] 카카오브레인 Pororo 설치 (Linux, WSL2) (4) | 2023.07.27 |
---|---|
[Linux] anaconda 리눅스 커널에서 설치 (wget 사용) (0) | 2022.05.25 |
포팅(Porting) 설명 링크 (0) | 2022.03.04 |
[용어 정리] RFP (RequestForProposal) (0) | 2022.01.24 |
데이터 관련 용어 (0) | 2022.01.13 |