実現したいこと
ローカルの作業ブランチをリモートにpushしたい
発生している問題・エラーメッセージ
% git push origin feature/XXXX ! [rejected] ブランチ名 -> ブランチ名 (non-fast-forward) error: failed to push some refs to 'https://github.com/リモートブランチ.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.
試したこと
最初のエラーは、「rejected(fetch first)」でした。
最新をマージしてpushし直すことを試みました。
git checkout develop git pull develop git checkout ブランチ名 git merge develop git push origin ブランチ名
としますと、表題のエラーになりました。
そこで作業ブランチ上でgit pullとしてみました。
git pull error: You have not concluded your merge (MERGE_HEAD exists). hint: Please, commit your changes before merging. fatal: Exiting because of unfinished merge.
ググった所、「git reset --merge」すると良いとあったため
【Git】Git Pull時に「You have not concluded your merge.」エラーが発生する時の対処法
git pullとしたところ、ブランチを指定しろと言われてしまいました。
当たり前かもですが・・。
ですが、これって先ほどdeveloブランチを最新にしてmergeしたので同じことでは??
堂々巡りになってしまい、どうして良いのか?
何がまずかったのか分からずにいます。
git reset --merge git pull There is no tracking information for the current branch. Please specify which branch you want to merge with. See git-pull(1) for details. git pull <remote> <branch> If you wish to set tracking information for this branch you can do so with: git branch --set-upstream-to=origin/<branch> ブランチ名
先輩方アドバイスお願いします。
0 コメント