GitでGithubと連絡してフォルダを送れない
解決したいこと:
すでに作られているGitのフォルダ、ファイル群をGithubにアップロードしてgit管理したい
発生している問題・エラー:
gitでリモートにpushしたいデータがあるのですが、git push origin mainとすると下記のエラーが出てきてしまい、困っています。
(一人での環境ですが、今後の勉強のためにリモート操作ができるようになっていたいと思っています。)
error: failed to push some refs to 'github.com:名前/リポジトリ名.git'
出ているエラーメッセージを入力:
error: failed to push some refs to 'github.com:名前/リポジトリ名.git'
または、問題・エラーが起きている画像をここにドラッグアンドドロップ
エラー.png
該当するソースコード
ソースコードを入力
```git push origin main
自分で試したこと
念のため、今の状態を記しておきます。
git push - origin main
error: src refspec origin does not match any
error: src refspec main does not match any
error: failed to push some refs to '-'
git push --force-with-lease
fatal: The current branch 'main' has no upstream branch.
To push the current branch and set the remote as upstream, use
git push -f
fatal: The current branch 'main' has no upstream branch.
To push the current branch and set the remote as upstream, use
git push --set-upstream origin 'main'
To have this happen automatically for branches without a tracking
upstream, see 'push.autoSetupRemote' in 'git help config'.
git pull origin main
The authenticity of host 'github.com (64:ff9b::141b:b171)' 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])? y
Please type 'yes', 'no' or the fingerprint: y
Please type 'yes', 'no' or the fingerprint:
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
git pull origin 名前
The authenticity of host 'github.com (64:ff9b::141b:b171)' 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])? testRepository
Please type 'yes', 'no' or the fingerprint:
Host key verification failed.
fatal: Could not read from remote repository.
Please make sure you have the correct access rights
and the repository exists.
git remote add origin https://github.com/名前/リポジトリ名.git
今、試せないのが公開鍵と秘密鍵でSSH接続をするというものですが、これもやり方がわかりません。
かなり初心者なので、足りない情報などございましたらお答します。
ご教授よろしくお願いいたします。