k0b0's record.

Computer Engineering, Arts and Books

Gitのエラー:! [rejected] master -> master (fetch first)

 Gitを使ってリモートリポジトリにプッシュすると、以下のエラーが出て怒られる。

 [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://github.com/WakkyFree/binarycutter'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushin
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.

 エラーについて調べてみると以下のサイトに解決方法が記されていた。
www.wakky.tech

 とりあえず、以下のコマンドを実行すれば解決できるみたい(エラーの詳細は上記のページに譲る)。

$ git fetch
$ git merge origin/master
$ git push -u origin master