zoukankan      html  css  js  c++  java
  • source tree每次push都需要密码的解决方法

    Windows
    首先可以考虑使用GitHub for Windows,它已经包含了该助手,或者可以下载对应系统的版本:Windows 7、Windows 8、Source 版本,然后解压缩文件并将里面的git-credential-winstore.exe 放到git 所在的目录运行即可。下次再 commit 的时候,会弹出个窗口询问用户名和密码,填写一次即可永久保存了。注意,一定要将 git-credential-winstore.exe 复制到 git 所在目录。

    Mac
    安装 osxkeychain凭据助手,并在 Git 中设置使用。注意,Git 版本需要 1.7.9 及以上才可使用。如果已经安装了homebrew,那么应该已经自带了osxkeychain。
    一、测试凭据助手是否安装
    git credential-osxkeychain
    如果已安装,控制台会显示如下:

    usage: git credential-osxkeychain <get|store|erase>

    如果没有安装,那么可以使用curl下载并安装:
    $ 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

    接下来,将osxkeychain安装到与Git安装目录相同的位置:
    $ which git     # Find where git is installed
    /usr/local/git/bin/git
    $ sudo mv git-credential-osxkeychain /usr/local/git/bin/     # Move the file so git can access it
    Password: [enter your password]

    然后,在Git的全局配置中进行设置:
    $git config --global credential.helper osxkeychain

    执行如下命名后,第一次git push需要密码,后续都不需要了
    git config --global credential.helper osxkeychain
  • 相关阅读:
    Linux Ubuntu安装Mysql5.7
    Linux Ubuntu安装maven3.3.9
    Linux Ubuntu安装tomcat9
    Linux Ubuntu安装JDK1.8
    Win10 U盘安装ubuntu16.04 LTS 双系统
    Linux Mysql5.7 常用语句与函数
    在Linux CentOS 6.6上安装Python 2.7.9
    CentOS6下docker的安装和使用
    How to Install Apache Solr 4.5 on CentOS 6.4
    SpringBoot的日志管理
  • 原文地址:https://www.cnblogs.com/94pm/p/11090357.html
Copyright © 2011-2022 走看看