doggo

https://github.com/queq1890

【Github】push時に "! [remote rejected] master -> master (shallow update not allowed) " と出た時の対応

背景

portfolioでも作ろうと思って、昔mkdirしてgit init して放置していたportfolioと言う名前のディレクトリの中身を消去して、 Githubに作成した空のリポジトリにpushしようとしたら、こんなエラーが出た。

! [remote rejected] master -> master (shallow update not allowed

原因

古い.gitが残っているのが原因らしいので、portfolioディレクトリから削除してみる。

$rm -rf .git

削除後、適当にgit initしたりgit remote add origin hoge.gitして、もう一度pushしてみると無事成功した。