使用 Google Code 项目验证 SourceTree

发布于 2025-01-06 13:05:55 字数 1371 浏览 3 评论 0原文

我正在尝试将最新版本 SourceTree 与使用 Git 的 Google Code 项目结合使用。问题是,当我尝试推送更改时,它会抱怨身份验证:

git push -v --tags --set-upstream origin master:master
推送到[项目]
致命:远程错误:用户名/密码无效。
您可能需要使用您生成的 googlecode.com 密码;请参阅 https://code.google.com/hosting/settings
已完成,但有错误,见上文

我在设置中的任何位置都看不到输入密码的地方。我尝试搜索 Atlassain 的知识库 和 Google,但找不到任何相关内容。唯一的线索来自谷歌的项目页面,上面写着:

选项 1:使用以下命令获取 [项目] 存储库的本地副本:
git 克隆 [项目]
要推送更改,请使用您的 Google 帐户和生成的 googlecode.com 密码进行身份验证。
选项 2:通过 .netrc 保持身份验证:
将以下内容添加到您的 .netrc。
机器 code.google.com 登录 [电子邮件] 密码 [生成的 googlecode.com 密码]
确保克隆 URL 不包含您的用户名: git 克隆 [url]

还有 另一个 Google 页面 上面写着:

对于 Git 存储库,您可以将以下行添加到 .netrc 文件中,记录您有权提交访问的每个存储库域的密码。确保您已设置 .netrc 的权限,以便只有您的用户帐户才能读取它。

机器码.google.com 登录 [电子邮件] 密码 [密码]

这个问题是在我升级到最新版本的 SourceTree 后才出现的。 GUI 中是否有任何位置可以输入身份验证详细信息?我相信旧版本中有一个 GUI 选项,但我找不到了。我发现唯一允许您输入类似内容的地方是存储库的高级选项卡或主要首选项的常规选项卡。然而,在这两种情况下,它只要求提供电子邮件地址,而不要求密码。

I'm trying to use the latest version SourceTree with a Google Code project that uses Git. The problem is that when I try pushing the changes, it complains about authentication:

git push -v --tags --set-upstream origin master:master
Pushing to [project]
fatal: remote error: Invalid username/password.
You may need to use your generated googlecode.com password; see https://code.google.com/hosting/settings
Completed with errors, see above

I can't see a place to enter in a password anywhere in the settings. I tried searching Atlassain's knowledge base and Google but I couldn't find anything relevant. The only clue comes from Google's project page which says:

Option 1: Get a local copy of the [project] repository with this command:
git clone [project]
To push your changes, authenticate with your Google Account and your generated googlecode.com password.
Option 2: Stay authenticated with .netrc:
Add the following to your .netrc.
machine code.google.com login [email] password [generated googlecode.com password]
Make sure the clone URL doesn't contain your username:
git clone [url]

There's also another Google page which says:

For Git repositories, you can add the following line to your .netrc file recording your password for each repository domain you have commit access to. Make sure you have set the permissions on .netrc so that only your user account can read it.

machine code.google.com login [email] password [password]

This problem only started after I upgraded to the latest version of SourceTree. Is there any place in the GUI that I can enter in the authentication details? I believe that there was a GUI option in the old version, but I can't find it anymore. The only places I found that let you enter in something similar is in the Repository's advanced tab, or the General tab of the main preferences. However, in both instances, it only asks for an email address and not a password.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

半寸时光 2025-01-13 13:05:55

问题是,默认情况下 Google 会告诉(在 .git/config 中)您使用包含“USER@”部分的 URL。 SourceTree 看到这一点并假设用户名是 URL 中的用户并且没有密码。要解决此问题,只需删除 URL 中的“USER@”部分即可。然后,当您尝试推送更改时,SourceTree 将提示输入用户名/密码。

例如,代替:

https://[电子邮件受保护] /p/项目/

使用:

https://code.google.com/p/PROJECT/

有关详细信息,请参阅:https://answers.atlassian.com/questions/36585/entering-in-a-源树中的密码

The problem is that by default Google tells (in .git/config) you to use a URL which includes the "USER@" portion. SourceTree sees this and assumes that the Username is the user in the URL and that there is no password. To fix the problem, simply remove the "USER@" portion in the URL. Then when you try pushing your changes, SourceTree will prompt for a username/password.

For example, instead of:

https://[email protected]/p/PROJECT/

use:

https://code.google.com/p/PROJECT/

For more info, see: https://answers.atlassian.com/questions/36585/entering-in-a-password-in-sourcetree

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文