zoukankan      html  css  js  c++  java
  • Git 保存用户名和密码

    Git可以将用户名,密码和仓库链接保存在硬盘中,而不用在每次push的时候都输入密码。

    保存密码到硬盘一条命令就可以

    $ git config credential.helper store

    当git push的时候输入一次用户名和密码就会被记录

    参考

    $ man git | grep -C 5 password
    $ man git-credential-store

    这样保存的密码是明文的,保存在用户目录~的.git-credentials文件中

    $ file ~/.git-credentials
    $ cat ~/.git-credentials

    引用

    EXAMPLES

    The point of this helper is to reduce the number of times you must type your username or password. For example:

           $ git config credential.helper store
           $ git push http://example.com/repo.git
           Username: <type your username>
           Password: <type your password>
    
           [several days later]
           $ git push http://example.com/repo.git
           [your credentials are used automatically]

    The .git-credentials file is stored in plaintext. Each credential is stored on its own line as a URL like:

    https://user:pass@example.com

  • 相关阅读:
    基于Centos 7 vue+nginx+docker 的前端项目部署
    uni-app学习随笔
    微服务和Docker
    Ado.Net
    数据库(SQLServer)
    JavaScript
    CSS样式
    HTML前端标签
    vue中 拖动元素边框 改变元素宽度
    vue学习笔记14
  • 原文地址:https://www.cnblogs.com/mtcnn/p/9410013.html
Copyright © 2011-2022 走看看