• 카테고리

    질문 & 답변
  • 세부 분야

    기타 (개발 · 프로그래밍)

  • 해결 여부

    미해결

깃 푸시

21.01.09 22:03 작성 조회수 84

0

리눅스에서 블로그 작성하다
윈도우로 넘어오면서 문제가 생겼습니다.
이미 레포지터리가 있었기에 저는

git remote add origin (블로그 url)
git branch -M main
git push -u origin main 을 입력했는데 

! [rejected]        main -> main (fetch first)

error: failed to push some refs to '제 주소'

hint: Updates were rejected because the remote contains work that you do

hint: not have locally. This is usually caused by another repository pushing

hint: to the same ref. You may want to first 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.

라고 뜨네요

물론 커밋진행 한후에 일어난 일입니다.

답변 1

답변을 작성해보세요.

0

git push -f origin main 

로 입력해보시겠어요?

아니면 

git push -f origin master로 해보세요

아니면 윈도우이시면 [제어판] - [사용자계정] - [윈도우 자격증명 관리] - git에 들어가서 편집 자신의 계정을 입력해주세요.