【问题标题】:Is there a way to save username and password on aptana when connecting to github?连接到github时,有没有办法在aptana上保存用户名和密码?
【发布时间】:2013-08-02 01:31:34
【问题描述】:

我是使用 github 的新手,但我成功地提交并提取了一些代码,然后在进行更改后将其推回存储库。但是,当我在 github 上推送或拉取时,我每次都需要输入我的用户名和密码。有没有办法一次保存这些凭据而不再被询问? 我正在使用 Aptana Studio 3,构建:3.4.1.201306062137 和 ubuntu 12.04

【问题讨论】:

    标签: github aptana aptana3


    【解决方案1】:

    首先你需要告诉 git 你的名字,这样它才能正确地标记你所做的提交。

    $git config --global user.name "Your Name Here"
    # Sets the default name for git to use when you commit
    

    Git 将您的电子邮件地址保存到您所做的提交中。我们使用电子邮件地址将您的提交与您的 GitHub 帐户相关联。

    $git config --global user.email "your_email@example.com"
    # Sets the default email for git to use when you commit
    

    您的 Git 电子邮件地址应与您的 GitHub 帐户关联的电子邮件地址相同。

    我们需要设置的最后一个选项会告诉 git,你不想在每次与远程服务器通信时都输入用户名和密码。

    $git credential-osxkeychain
    # Test for the cred helper
    # Usage: git credential-osxkeychain <get|store|erase>
    

    要告诉 git 使用 osxkeychain,只需设置全局 git 配置:

    $git config --global credential.helper osxkeychain
    # Set git to use the osxkeychain credential helper
    

    下次克隆需要密码的 HTTPS URL 时,系统会提示您输入用户名和密码,并授予对 OSX 钥匙串的访问权限。完成此操作后,用户名和密码将存储在您的钥匙串中,您无需再次将它们输入到 git。

    希望这会有所帮助:/

    【讨论】:

    • 好的,我正在完成一些更新,我会尝试并回来
    • 在 git credential 步骤我得到 git credential-osxkeychain git: 'credential-osxkeychain' is not a git command。请参阅“git --help”。我在这里错过了什么吗?
    • 如果没有助手,则需要下载
    • $curl -s -O \ http://github-media-downloads.s3.amazonaws.com/osx/git-credential-osxkeychain # Download the helper chmod u+x git-credential-osxkeychain # Fix the permissions on the file so it can be run
    • 最后一件事,如果确实有效,请阅读此manpages.ubuntu.com/manpages/precise/man7/gitcredentials.7.html
    【解决方案2】:

    这将在 linux 上完成工作:

    $ git config credential.helper store
    

    【讨论】:

      猜你喜欢
      • 2010-10-01
      • 2016-11-18
      • 2012-06-16
      • 2016-09-14
      • 2020-11-11
      • 2022-01-13
      • 2011-04-15
      • 2016-12-19
      • 1970-01-01
      相关资源
      最近更新 更多