5
1

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 cloneしようとしたらremote: Repository not found.に阻まれた

Posted at

この記事でわかること

remote: Repository not found.
と出たときの対処法

背景

自身のポートフォリオとなるサイトを作る際に、GitHubを使おう!

GUIからリポジトリを作成

ローカルで作成していたサンプルコードをまずgit pushしよう!

PowerShell開いて、$ git clone https:///github.com/****/****.git

Cloning into 'myhomepage'...
remote: Repository not found.
fatal: repository 'https://github.com/****/****.git/' not found


さっき作ったしないわけない...
あ、もしかしてアカウントのせい?

じゃあどうすれば良いんだろう...←いまここ

現アカウントの確認

とりあえず今ログインしているアカウントを調べます

git config --global user.name
git config --global user.email

これが使いたいアカウントでない場合は設定し直す必要があります

アカウントの切り替え

アカウントは先ほど確認したものに新しいものを加えるように書けば切り替えられます

git config --global user.name <NEW_NAME>
git config --global user.email <NEW_EMAIL>

SSH Keyを設定

httpsでのgit cloneを諦め、sshでやることにしました
その際にSSH Keyを設定する必要があったのでこちらの記事を参考にしました

いざ、git clone

git clone git@github.com:****/****.git
Cloning into '****'...
Enter passphrase for key '/c/Users/****/.ssh/****':
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (3/3), done.
remote: Total 6 (delta 0), reused 0 (delta 0), pack-reused 0
Receiving objects: 100% (6/6), done.

はい、ということで無事解決しました

5
1
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
5
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?