[Git] ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://github.com~ 에러 해결

Dev.choi·2021년 5월 18일
0

Github

목록 보기
1/1
post-thumbnail


.

💢 무슨 에러일까

vs code에서 파일을 수정하고 깃허브에 커밋하려는데 이 에러가 뜬다.. 구글링의 가호를 받아 에러를 해결할 수 있었다. 로컬 저장소를 처음 생성할때 내가 빠뜨린 명령어가 있었다.

git pull orgin master --allowed-unrelated-histories
이 명령어로 원격 저장소와 로컬 저장소의 병합 허용한다.

.
.
.

👩‍💻에러 해결

  1. git init
  2. git add .
  3. git pull orgin master --allowed-unrelated-histories
  4. git push -u orgin master
    .
    .
    .

✋ 성급함 멈춰!

사실 커밋 과정에서 git pull orgin master 명령어만 차근차근 써주면 이 에러는 날 일이 없다. 성급함 멈춰!

.
.
.
.

출처 : https://helicopter55.tistory.com/39

profile
웹앱 공부 중입니다.

0개의 댓글