본문으로 바로가기
반응형

깃허브로 들어가서 repository를 생성하고 리모트 등록 후 푸시를 요청했다.

그런데 아래와 같은 에러가 발생하면서 제대로 동작하지 않았다.


➜  graphql git:(master) git push -u origin master

To https://github.com/teamhide/graphql_mysql.git

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

error: failed to push some refs to 'https://github.com/teamhide/graphql_mysql.git'

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.


찾아보니까 로컬이랑 리모트랑 동기화가 안되서 발생한 현상인듯하다.

내가 초반에 레포지토리를 생성하고 푸시를 했었는데,

그 이후에 리모트에서 README.md 파일을 생성하고 pull을 안해줘서 그런가보다.

아래의 명령어를 한번 실행해준다.


git pull origin master


그런 다음 다시 푸시해준다.


git push -u origin master



반응형