前提・実現したいこと
RailsでWEBアプリを作成しております。
開発環境はCloud9でオンラインレポジトリとしてGithubを使っております。
今回一度commitしたところからHEADを一度前回のコミットに戻して作業を追加して、
再度コミットしようとしたらエラーが出て困っております。
リモートレポジトリ(Github)にローカルレポジトリの内容を反映させたい。
リモートとローカルで内容が違うのでgit push時エラーが出る。
ローカルレポジトリの内容をリモートレポジトリに上書きしたい。
発生している問題・エラーメッセージ
ec2-user:~/app/alpha-blog/alpha-blog (master|REBASE-i 2/2) $ git push To github.com:yuks0810/alpha-blog.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'git@github.com:yuks0810/alpha-blog.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.
試したこと
調べてみて、pull, marge, rebaseなどあったのですが、一度ローカルの直近のデータが消えてしまって手動で
書き直したので、もう一度やるのは大変なのでデータ消えるの怖くて触れません。。。
###レポジトリ内容
リモートレポジトリ(Github)
https://github.com/yuks0810/alpha-blog/commits/master
一応スクショです。
https://gyazo.com/6593bab6b49e8bfe217d83d7968a9036
ローカルレポジトリ
ec2-user:~/app/alpha-blog/alpha-blog (master|REBASE-i 2/2) $ git log --oneline 31efcb7 (HEAD -> master) 各ページへのリンク付け & CSS個別切り替え d64ab11 既存の記事の編集を可能に 9a2659d 各ページへのリンク付け & CSS個別切り替え aa8b83f 既存の記事の編集を可能に c30a174 fix create, add flash and error messages, craete show c1855bb create new template, action and route 0e3d936 article table 作製, model and validations 追加 8b3ece4 76. introduction to section 4 f77eb63 css fixing 69b430a css fixing 67d0443 update html and css to the one with image f9d3ae1 update on 20th of June 823b713 modify readme for repo 05f9d8b Make app production ready
と相違があるので、リモートレポジトリの内容をローカルレポジトリの内容に上書きしたいです。
どなたかご教授お願い致します。
回答2件
あなたの回答
tips
プレビュー
バッドをするには、ログインかつ
こちらの条件を満たす必要があります。
2019/06/23 05:40