たまに起こるのでメモします。
ブランチ切って作業していて完成したからpushしようとしたらrejectされた。
エラー文を見てみると下記が原因らしい。
Updates were rejected because the tip of your current branch
is behind
頻繁にpullしてるつもりなんですが、、僕がpushするまでの間に、他の人
のpushがあるなどしてリモートが変更されている状況のときに起こるっぽい
ですね。
対処方法はググるとたくさん出てきますが、このときhintってのが出てて
"git pull ..."って書いてある。今までpullっていうとmasterから
pullするってことしか頭になかったんですがね、、、とりあえず
git pull origin master
してみた。直らない。
いろいろやっててたらどうやらpullの指定先を間違っていた。作業ブランチが
hogeのときで、このエラーがなかなか直らないときはgit pull origin hoge
ってのをやってみましょう。
僕はこれで直りました。
More than 5 years have passed since last update.
Register as a new user and use Qiita more conveniently
- You get articles that match your needs
- You can efficiently read back useful information
- You can use dark theme
List of users who liked
166114