원본(내꺼내가쓴다는데!) : http://blog.naver.com/imf4/220770291497


GitHub_gitBash : remote 저장소 push하려는데 reject될때 조치방법


필자가 git push origin master 로 commit한 내용을 remote 저장소에 업로드 하려는데 리젝됐다. 아래 메시지가 뜨면서..

To https://github.com/geoseong1/geoseong.git

 ! [rejected]        master -> master (non-fast-forward)

error: failed to push some refs to 'https://github.com/geoseong1/geoseong.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.




원인은 push하기 전 & 작업하기 전에 git pull 명령어를 통해서 원격저장소의 최신상태를 유지한 상태에서 push를 했었어야 했다..

그런데 나는 그렇지 않았기 때문에 이런 에러가 뜬 것이었다..


본인이 조치한 사항.

1. git pull

2. 로컬 저장소에서 변경된 내용 확인 및 작업

3. git commit -a ( 'master' branch를 통합한다 )

: 그런데 우선 git commit -m "메시지" 로 먼저 시도를 해 볼 것을 추천한다. 근데 안된다면 1번부터 다시 해봐야 한다.

4. git push "리모트저장소 닉네임" "브랜치이름"

 

+ Recent posts