• Git命令--保存用户名和密码


    使用git各项操作时,总是会出现输入密码的弹窗,且需要多次输入,很是繁琐,通过git命令可以记住密码,避免多次操作。

    一、创建保存密码的文件

               1、在home文件夹,一般是 C:Documents and SettingsAdministrator 下建立文件 .git-credentials(不要带文件 

                     后缀名,windows下不允许直接创建以.开头的文件, 所以有一个小技巧:先创建一个文件名叫 )git-

                     credentials 然后进入 git bash 使用命令:mv git-credentials .git-credentials将文件重命名成 .git-credentials

                2、用记事本打开这文件输入:https://{username}:{password}@github.com,保存

                     如:https://zhangsan:123456@github.com

     二、添加config项

                      1、进入 git bash然后输入:git config --global credential.helper store,执行完后去查看 C:Documents and 

                     SettingsAdministrator.gitconfig 这个文件,发现多了一项:[credential] helper = store,就成功了。

    三、然后要重开 git bash 窗口,再提交就不用输入用户名密码

                  注:第一次提交时还是需要输入 密码的,输入一次后就不用输入了

  • 相关阅读:
    elasticsearch如何设计索引
    LinkedList 的实现原理
    聊聊elasticsearch7.8的模板和动态映射
    elasticsearch7.8权限控制和规划
    cloudera manager server迁移
    2020年终总结
    工作两年半的一次复盘
    聊聊数据结构和算法
    AutoMapper源码解析
    [源码解析] 并行分布式框架 Celery 之 worker 启动 (2)
  • 原文地址:https://www.cnblogs.com/candyzhmm/p/7084791.html
Copyright © 2020-2023  润新知