1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【GitHub】error: failed to push some refs to "URL"の対処法

Last updated at Posted at 2021-03-18

プログラミング勉強日記

2021年3月18日

エラー内容

 GitHubにpushしようとしたときに以下のエラーが出た。

$ git push origin ブランチ名
To https:///githubのURL
[rejected]develop -> develop (non-fast-forward)error: failed to push some refs to 'https://githubのURL'

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.

原因

 調べてみると、コミットする前にREADMEの変更を行っていたのが原因だった。前に一度リモートにpushした整合性がとれずにずれているのが原因みたいだった。

解決方法

$ git fetch
$ git merge origin/master

参考文献

【git】error: failed to push some refs to "URL"のエラー対処法
git push 時の error: failed to push some refs to

1
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?