1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

【初心者用】 ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to ...

Last updated at Posted at 2019-04-29

####トラブルメモ

$ git push origin master

を実行すると、

! [rejected] master -> master (non-fast-forward) error: failed to push some refs to ...

というメッセージが出てpushできない。

色々調べたが、結局、下のコマンドだけで事足りた。

$ git reflog

コミットしたログ履歴表示

$ git reset --hard 'HEAD@{xx}'

履歴から選択した番号をxxに入力し、状態を戻す

$ git push origin master --force
$ git push heroku master --force

強引?にpushする。

今の状態でよければ、下の2つだけで。

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?