プルをした後にプッシュを行おうとすると下記のエラーメッセージが出力されて
プッシュすることができません。
対処法をご教授お願いします。
<エラーメッセージ>
git -c diff.mnemonicprefix=false -c core.quotepath=false --no-optional-locks push -v --tags origin master:master
Pushing to https://xxxxxx@bitbucket.org/xxxxxx/test.git
To https://bitbucket.org/xxxxxx/test.git
! [rejected] master -> master (fetch first)
error: failed to push some refs to 'https://xxxxxx@bitbucket.org/xxxxxx/test.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 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.
よろしくお願いいたします。
こんにちは、アトラシアンの山本です。
エラー文言によると、リモートリポジトリ側に変更が入っているためローカルリポジトリの内容を push できないようです。メッセージ内の案内通り、一度 git pull, git fetch などで手元に持ってきたうえで、状況に応じて merge やコンフリクトの解消などを行い再度 git push をお試しいただけますでしょうか。
ご回答ありがとうございます。
ご教授頂いた内容で試した見たのですがやはり状況は変わりませんでした。
フェッチを行った後、マージを行った影響がわからなかったためマージせずにプッシュしたため解消しなかったのかもしくは何か他の原因が関係しているのでしょうか。
申し訳ございませんがよろしくお願いいたします。
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
マージせずにプッシュしたことが原因になっていることが疑われます。
もし自身の管理するリポジトリでない場合は、リポジトリの所有者へ連絡をとって方針を確認いただき、方針に沿ってご対応をいただけますとさいわいです。
一般的にはブランチを切ったり、リポジトリ自体をフォークしたりすれば、元の master 自体を書き換えてしまうことはないため、影響を抑えて git push することが可能です。その後、プルリクエストを作成して元の master との差分をリポジトリの所有者などからのレビューを経て変更点を取り込んでもらうワークフローが一般的なユースケースです。
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ご回答ありがとうございます。
> マージせずにプッシュしたことが原因になっていることが疑われます
上記の通りフェッチした後にマージを行いプッシュを試してみましたが
状況は変わりませんでした。
何か他の要因が関係しているのでしょうか。
たびたびの質問申し訳ありませんがよろしくお願いいたします。
以上、よろしくお願いいたします。
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
お世話になっております。
今回の障害についてですがリモートリポジトリ側が原因でプルができなかったようです。
リモートリポジトリ側の障害を解消してもらったところ正常にプッシュできるようになりました。
たびたびの質問等ご迷惑おかけしましたがありがとうございました。
以上、よろしくお願いいたします。
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ご返信ありがとうございます。
リモートリポジトリ側の対応で無事解決したとのこと、お聞きできてなによりです。
今後ともどうぞよろしくお願いします。
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.