如何在 Sourcetree 中与 Github 建立基本连接

How to make a basic connection to Github in Sourcetree

当试图从 SourceTree 中的 Github 克隆一个 repo 时,它一直告诉我 repo URL 无效,当我直接从 repo 的 [=] copy/pasted 25=]页。

我正在使用 HTTPS 并尝试在 SourceTree 中建立基本连接

Github 连接尝试:

我确定我输入的用户名和 github 密码正确,但它说无法连接?

我希望我的 Github 用户名和密码能够建立连接,但似乎没有。

所以问题是我给了它我的实际 Github 帐户密码,它正在寻找的是为我的帐户创建的个人访问令牌。

为此,我转到我的 github 帐户页面设置 > 开发人员设置 > 个人访问令牌并创建了一个新令牌。在 SourceTree 帐户连接面板的 'password' 部分使用该令牌我能够连接!

SourceTree 接受您的 GitHub 密码的一个原因是 "looking for a PAT -- Personal Access Token --, is that, as mentioned in "Creating a personal access token for the command line":

A personal access token is required to authenticate to GitHub when you're using two-factor authentication.

如果您有 2FA,则需要 PAT 作为密码。