티스토리 뷰

반응형

git을 사용하기 위해서 bitbucket을 이용하였습니다.


bitbucket에 처음 프로젝트를 만들고 어떻게 android studio에 연결하나 고민하다가 자료가 있어서 올립니다.




만약 git push -u origin master  을 사용하였으나  에러가 발생 시  -f 로 push 하시면 됩니다.


https://github.com/aniruddhabarapatre/learn-rails.git


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

error: failed to push some refs to 'https://github.com/aniruddhabarapatre/learn-rails.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 merge the remote changes (e.g.,

hint: 'git pull') before pushing again.

hint: See the 'Note about fast-forwards' in 'git push --help' for details.


$ git push -f origin master


그래도 안되는 경우도 있습니다. 그럴 경우는 "pull" >  "push -f" 하시면 됩니다.


$ git pull


$ git push -f origin master


git push 만 입력하고 업데이트를 진행하고 싶다면 push -u으로 하시면 됩니다.


$ git push -u origin master





참고

http://stackoverflow.com/questions/20939648/issue-pushing-new-code-in-github


반응형
댓글