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 1 year has passed since last update.

エラー ![rejected]master -> master (fetch first)

Last updated at Posted at 2022-10-18

↓こんなエラーが出た時の対処法

! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'github.com:アカウント名/リポジトリ名'

解決手順

調べてみた手順でfetchしてみたりしたけど同じエラーが出続けたので
まだ最初でもあるしやり直した。

①PCのフォルダ内の「.git」フォルダを右クリック削除
②gitの初期化「git init」
③下記の順番でpushまでをやったら
④うまくいった

git init
git remote add origin git@github.com:アカウント名/リポジトリ名'
git fetch
git merge origin/master
git checkout master
git add .
git commit -m "コミットメッセージ"
git push origin master
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?