以前、初回pushできたがディレクトリ構成がおかしなことになっていたため、再度トライ。またエラー表示出たので、メモしておきます。
「git init」してから初回SSH接続する際に
「git remote add origin <ssh接続用のコード>」まで問題なくいきましたが、最後pushすると下のようにエラー表示されました。
| 
					 1 2 3 4 5 6 7 8 9 10 11  | 
						The authenticity of host 'github.com (52.69.186.44)' can't be established. ED25519 key fingerprint is SHA256:+DiY3wvvV6TuJJhbpZisF/zLDA0zPMSvHdkr4UvCOqU. This key is not known by any other names Are you sure you want to continue connecting (yes/no/[fingerprint])? yes Warning: Permanently added 'github.com' (ED25519) to the list of known hosts. git@github.com: Permission denied (publickey). fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.  | 
					
どうやらSSH接続の設定が確立されていない?みたいなので、下の参考サイトを元にしてSSHキーの初回設定を行いました。
| 
					 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22  | 
						$ ssh-keygen Generating public/private rsa key pair. Enter file in which to save the key (/c/Users/eigen/.ssh/id_rsa): Enter passphrase (empty for no passphrase): Enter same passphrase again: Your identification has been saved in /c/Users/eigen/.ssh/id_rsa Your public key has been saved in /c/Users/eigen/.ssh/id_rsa.pub The key fingerprint is: SHA256:FaNr5dzJ/wl4BRZbShcnoqCl4PMs2zlNvzDtkKwKciw eigen@LAPTOP-LJ4QN1Q3 The key's randomart image is: +---[RSA 3072]----+ |    .   o o .o.+o| |   . . + o +..*..| |    o o . +  =   | |     +   * o...  | |    . o S o +  . | | .   + * +  ...  | |E + . + B o. o.  | | + .   o = .. ...| |    ...   o    ..| +----[SHA256]-----+  | 
					
対話(入力を求められる)を全てエンターキーで押すと上のようになって終了。
次に、「cat」コマンドでGitHubに登録する用の鍵を確認。
| 
					 1 2  | 
						$ cat ~/.ssh/id_rsa.pub  | 
					
このコマンドで出力されたキー(文字列)を全てコピー。
次に、GitHubのダッシュボードにいって、右上の個人アカウント設定用のアイコンをクリック→「Settings」をクリック→左側のパネルの「SSH and GPG keys」をクリック→「SSH keys」の段落の右側にある緑色のボタン「New SSH key」をクリック。
そうすると、登録する画面が出てくる。
上のtitle欄にはpushするデバイスの名前を他と区別がつくように分かりやすく記載。
下の欄にはコピーしたSSHキーをペースト。
で、登録完了。
無事にpushすることができました。
【参考サイト】
        
        
        
        
        
        
  
  
  
  

