git配置config记住密码
设置记住密码(默认15分钟):
git config --global credential.helper cache
如果想自己设置时间,可以这样做:
git config credential.helper 'cache --timeout=3600'
这样就设置一个小时之后失效
长期存储密码:
git config --global credential.helper store
增加远程地址的时候带上密码也是可以的。(推荐)
从仓库的config的里面修改url,后面加上密码
http://yourname:password@git.oschina.net/name/project.git
补充:使用客户端也可以存储密码的。
git设置用户名密码
设置git用户名/邮箱
git config --global user.name [username]
git config --global user.email [email]
但是这个仅仅是设置用户名密码,如果你的git 源每次操作需要你输入用户名/密码验证,你依然需要每次设置,那么该如何办呢?
git保存用户名密码
这里主要是配置一个config项
有两个方法,基本上原理都是一样,都是修改.git/config文件
1.使用如下命令,修改config文件即可保存
echo "[credential]" >> .git/config
echo " helper = store" >> .git/config
2.直接修改.git/config文件
在linux/mac下可以直接使用vim工具修改config文件
ubuntu@VM-7-212-ubuntu:~/kernel-code/kernel-netfilter-sample-code$ vim .git/config
##修改成如下
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
[remote "origin"]
url = https://github.com/Miss-you/kernel-netfilter-sample-code.git
fetch = +refs/heads/*:refs/remotes/origin/*
[branch "master"]
remote = origin
merge = refs/heads/master
##主要是后面这两行,如果不想保存,则删除即可
[credential]
helper = store
##保存
这样就可以保存用户名密码,不用每次都输入了!
git config查看配置
使用git config --list查看已设配置
feiqianyousadeMacBook-Pro:xt_GTPU yousa$ git config --list
core.excludesfile=/Users/yousa/.gitignore_global
user.name=Miss-you
user.email=snowfly1993@gmail.com
core.repositoryformatversion=0
core.filemode=true
core.bare=false
core.logallrefupdates=true
core.ignorecase=true
core.precomposeunicode=true
remote.origin.url=https://github.com/Miss-you/xt_GTPU.git
remote.origin.fetch=+refs/heads/*:refs/remotes/origin/*
branch.master.remote=origin
branch.master.merge=refs/heads/master
git配置config记住密码的更多相关文章
- git配置config文件
1.Git有一个工具被称为git config,它允许你获取和设置变量:这些变量可以控制Git的外观和操作的各个方面.这些变量以等级的不同可以被存储在三个不同的位置: (1) /etc/gitconf ...
- Git 配置用户名、密码
在终端输入: git config --global credential.helper store 然后git pull一次,输入一次用户名密码就会自动保存该用户名密码: 查看配置的用户信息: gi ...
- Git配置的用户名密码在本地的存贮位置
全局的用户名密码配置: //配置用户名和邮箱(全局) $ git config --global user.name "j***n" $ git config --global u ...
- Git配置全局账号密码避免每次拉取、提交输入账号密码
前言 在大家使用github的过程中,一定会碰到这样一种情况,就是每次要push 和pull时总是要输入github的账号和密码,这样不仅浪费了大量的时间且降低了工作效率.在此背景下,本文在网上找了两 ...
- 让git for windows记住密码
store 执行这个命令git config --global credential.helper store 检查命令是否成功 $ git config -l | grep credentialcr ...
- Git配置用户名、邮箱、密码
配置用户名:username git config --global user.name username 配置邮箱:user@email git config --global user.email ...
- git 配置 https和ssh 免密码登录 常用操作命令
git 配置 https和ssh 免密码登录 一. 区分https clone 和 ssh clone 不同的克隆方式导致校验方式不同,对应的免秘方式也不一样. https通过记住账号密码免登,ssh ...
- git https连接方式,记住密码
Git使用https方式进行连接时,默认每次推送时都要输入用户名和密码. 可以使用命令 $git config credential.helper store 为当前仓库设置记住密码,设置后,只要在推 ...
- 在idea中设置记住git的用户名和密码
在idea中设置记住git的用户名和密码 1.在项目根目录下执行以下git命令: git config --global credential.helper store 2.执行上述命令后,在idea ...
随机推荐
- mybatis逆向工程mbg
mbg:mybatis generator=mybatis代码生成器 1.看一下项目结构 其中bean文件,mapper接口文件和mapper.xml文件是代码生成器自动生成的. 使用generato ...
- Visual C++中MFC消息的分类
Visual C++中MFC消息的分为三类:标准(窗口)消息.命令消息.控件消息. 1.标准(窗口)消息:窗口消息一般与窗口内部运作有关,如创建窗口,绘制窗口,销毁窗口,通常,消息是从系统发到窗口,或 ...
- CPP-基础:临界区
VC windows api 多线程---临界区 临界区(Critical Section)是一段独占对某些共享资源访问的代码,在任意时刻只允许一个线程对共享资源进行访问.如果有多个线程试图同时访问临 ...
- RabbitMQ之五种消息模型
首先什么是MQ MQ全称是Message Queue,即消息对列!消息队列是典型的:生产者.消费者模型.生产者不断向消息队列中生产消息,消费者不断的从队列中获取消息.因为消息的生产和消费都是异步的,而 ...
- 【题解】洛谷P2375 [NOI2014] 动物园(KMP)
洛谷P2375:https://www.luogu.org/problemnew/show/P2375 思路 这道题可以说是完全刷新了本蒟蒻对KMP的理解 感觉对next数组的理解上升到一个新的高度 ...
- 【Node.js】新建一个NodeJS 4.X项目
前提工作 1.安装Node.js 各种下一步就好 2.安装NPM(node package manager) 安装好Node.js之后,打开cmd,输入npm install npm -g,程序会自动 ...
- JQuery Ajax 使用FormData上传文件对象
FormData部分: 先new FormData对象 :let somedata = new FormData(),然后将数据添加进去,这里我们使用append()进行添加. 这里举一个上传头像的例 ...
- iOS之改变UIAlertViewController字体的颜色
NSString *message = @"请确认信息是否正确?"; NSString *title = @"提示"; UIAlertController *a ...
- Springmvc+Spring+Mybatis整合开发(架构搭建)
Springmvc+Spring+Mybatis整合开发(架构搭建) 0.项目结构 Springmvc:web层 Spring:对象的容器 Mybatis:数据库持久化操作 1.导入所有需要的jar包 ...
- SQL Server 2012 - 多表连接查询
-- 交叉连接产生笛卡尔值 (X*Y) SELECT * FROM Student cross Join dbo.ClassInfo --另外一种写法 SELECT * FROM Student , ...