0
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.

git pushの際に起きたエラー

Posted at

git push origin main のコマンドを叩いた際に以下のようなエラーが、

fatal: 'origin' does not appear to be a git repository
fatal: Could not read from remote repository.

これは"origin"とはなんぞ?
と言われている状態。
登録しているリモートリポジトリの名前を確認してみます。

git remote -v

"zipcloud-rails"

つまり全然origin とは違います。

git push zipcloud-rails main こちらを試しました。
すると今度は

error: failed to push some refs to 'https://github.com/**********/zipcloud-rails.git'
hint: Updates were rejected because the remote contains work that you do
hint: not have locally. This is usually caused by another repository pushing
hint: to the same ref. You may want to first integrate the remote changes
hint: (e.g., 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.

の表示が。
しかしここまで来ればそんなに焦る必要はありません。
あくまでも個人開発ですから、無敵です。

git push --force zipcloud-rails main

これで解決しました。

0
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
0
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?