###私の環境
laravelでアプリを作りました。
ファイル構成は
larvalApp
-Homestead
-code(この中にlaravelの環境)
のようになっており、codo以下をsouretreeでバージョン管理しています。
###現在の状況
sourcetreeからherokuへpushしたところ以下のエラーが出ます
Pushing to https://git.heroku.com/herokuname.git To https://git.heroku.com/herokuname.git ! [rejected] master -> master (non-fast-forward) error: failed to push some refs to 'https://git.heroku.com/herokuname.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.
検索してみると、このエラーについては様々な記事がありますが、どうしても解決できません。
##試したこと
- sousetreeを使わず、ターミナル からデプロイ
git init git add -A git commit -m 'first commit' git push heroku master
2. 強制的にpush
git push heroku master -f
これは無理やりできましたが、真っ白な画面でRouteも機能していなかったので、解決にはなっていないようでした。
3.
git fetch git merge origin/master
これが一番よくみる解決方法でしたが、解決できませんでした。(同じようにエラーが出ました)
#追記
どこで作業しているか記述していませんでした。
上記コマンドは
Homesteadのディレクトリでherokuにloginしたのち、実行しています。
vagrant@homestead:~$
の状態です。
念のためと言いますか、
ホームディレクトリにSourcetreeからコードを持ってきて、同じくpushしてみましたが同様のエラーでした。
何か根本的に間違っているのでしょうか?
解決案がありましたら教えていただけると助かります!
あなたの回答
tips
プレビュー