![見出し画像](https://assets.st-note.com/production/uploads/images/146271830/rectangle_large_type_2_67aad9a49fdd88460649bcff173e0374.png?width=1200)
Photo by
golchiki
error: failed to push some refs to 'github.com:{name}/{repository}.git'
ローカルで編集したディレクトリにて
git pull
git add .
git commit -m "{commit message}"
git push
を行うと
! [rejected] main -> main (non-fast-forward)
error: failed to push some refs to 'github.com:{name}/{repository}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.
というエラーが発生
とりあえず
git merge --allow-unrelated-histories
git add .
git commit -m "{commit message}"
git push
したらpushできた
この記事が気に入ったらサポートをしてみませんか?