Sourcetreeでgithubのリポジトリをクローンしようとすると
“remote: Repository not found.”
といったエラーでクローンできなかったときの対処法です。
対処法
エラー内容
Sourcetreeで「URLからクローン」を選択。
![](https://yuhabeem.com/wp-content/uploads/2021/06/スクリーンショット-2021-06-19-19.40.19-1024x1024.png)
ソースURLにgithubのリポジトリを入力
![](https://yuhabeem.com/wp-content/uploads/2021/06/スクリーンショット-2021-06-19-19.42.50-1024x439.png)
「有効なソースパス/URLではありません」というエラーが表示されて、クローンできません。
エラー詳細を見ると
remote: Repository not found.
fatal: repository ‘https://github.com/xxx.git/’ not found
というエラーでした。
対策
ソースURLに「{username}:{password}@」を追加することでクローンできるようになりました。
以下のように変更です。”username”,”password”はgithubのアカウントを入力してください。
「https://github.com/xxx.git/」-> 「https://{username}:{password}@github.com/xxx.git/」
![](https://yuhabeem.com/wp-content/uploads/2021/06/スクリーンショット-2021-06-19-19.42.20-1024x437.png)