🗂

Sourcetreeでgithubのリモートリポジトリ作成

に公開

題名の通り、Sourcetreeでgithubのリモートリポジトリを作成・設定する際に、エラーになったので、解消方法を記載します。

githubでリポジトリを作成した後、ダッシュボードのURLをSourcetreeで設定した際に下記のようなエラーがおきました。

Pushing to https://github.com/●●●●/●●●●.git
remote: Permission to ●●●●/●●●●.git denied to ●●●●.
fatal: unable to access 'https://github.com/●●●●/●●●●.git/': The requested URL returned error: 403
Completed with errors, see above

解決方法

Sourcetreeが仕事用のアカウントで設定されているからなのかもしれませんが、
Sourcetreeで設定するURLのgithub.comの前にアカウント名@を入れるとうまくいきました。

https://アカウント名@github.com/●●●●/●●●●.git

Discussion