コンテンツにスキップ

Mkdocs用コマンド実行時のエラー対処

■エラーその1

1
2
3
4
5
Username for 'https://github.com': 
Password for 'https://44hero@github.com':
remote: Support for password authentication was removed on August 13, 2021.
remote: Please see https://docs.github.com/en/get-started/getting-started-with-git/about-remote-repositories#cloning-with-https-urls for information on currently recommended modes of authentication.
fatal: Authentication failed for 'https://github.com/44hero/tech_memo.git/'

というエラーが出て、先へ進めない

これは、個人アクセストークン の更新によるものである。

手順は以下

  1. Username の入力

    44heroEnter

    Username for 'https://github.com':44hero
    

  2. Password の入力

    個人アクセストークン のことを言っているので、入力する
    ███_████████████████████████████████████Enter

    Password for 'https://44hero@github.com':███_████████████████████████████████████
    

参考:外部サイト

■エラーその2

1
2
3
4
5
6
7
8
9
git push -u origin master 
To github.com:44hero/tech_memo.git
 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'github.com:44hero/tech_memo.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.

というエラーが出て、先へ進めない

  • 上記のエラーは自分がリモートの変更をpullしてから、pushするまでの間に、他からのpushがあるなどして、リモートリポジトリが変更されているためです。

  • これは自分がリモートの変更をpullしてから、pushするまでの間に、他からのpushがあるなどしてリモートが変更されているためです。
    エラーメッセージが教えてくれているように、ブランチの先端がリモートのより後ろになっています。
    ローカルの master ブランチを shared の master とマージしてあげる必要があります。
    git pull でマージした後、改めてpushしましょう。

が要因とのことです。。

手順は以下

  1. fetchして

    git fetch
    
  2. merge して

    git merge
    

    これでGitHub上で更新したREADME.mdがローカルに取り込まれた。

  3. 最後にエラーが出たpushコマンドを実行

    git push -u origin tech_memo
    

上記のコマンドで、ローカルリポジトリのmasterブランチをリモートリポジトリのmasterへmargeさせてあげた後に、
再度pushし直します。

参考:Google検索全体

参考:外部サイト

参考:外部サイト


以上



最終更新日: 2024年4月18日 09:56:47