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 ...
随机推荐
- jsp和servlet的问题收集.... 答案有部分是自己理解的,可能有点差异
如何创建一个动态工程? File ----> New ---->other ---->Web ---->Dynamic Web Project 选择动态WEB 项目工程 W ...
- jmeter报告优化---展示详细信息
参考文档:https://www.cnblogs.com/puresoul/p/5049433.html 楼上博主写的还是很详细,在报告优化这块,但是在操作中也走了一些弯路,我改动了两个点才成功,根据 ...
- PowerDNS简单教程(1):安装篇
这一篇开始直接是PowerDNS教程,连续四篇.DNS的相关背景知识我就不介绍了,有需要的话看看 http://baike.baidu.com/link?url=QcthFpAb2QydMqcMJr9 ...
- django.db中的transaction
transaction.set_autocommit(0) ..... ........ ................ transaction.commit() 可以使夹在其两句中间的所有SQL语 ...
- 使用GraphViz画caffe网络结构图
参考http://blog.csdn.net/happynear/article/details/45440709 1. 安装pydot: sudo pip install pydot 2. 安装Gr ...
- div拖动
<!DOCTYPE html><html xmlns:th="http://www.thymeleaf.org"><head> <meta ...
- [转]表单提交:button input submit 的区别
博客转自于 http://harttle.com/2015/08/03/form-submit.html ,同时自己做了稍微改动 最近项目代码中的表单提交的方式已经百花齐放了,现在用这篇文章来整 ...
- 【题解】洛谷P3952 [NOIP2017TG] 时间复杂度(模拟)
题目来源:洛谷P3952 思路 纯模拟没啥可说的了 果然好复杂 参考了你谷一个40行代码 代码 #include<iostream> #include<cstdio> #inc ...
- RfcDestinationManager.UnregisterDestinationConfiguration时报错cannot unregister the given destination configuration
在使用NCO访问SAP的RFC时,我的程序代码是这么写的: string destinationName = "EWM_700_GROUP"; IDestinationConfig ...
- ubuntu software center和新立得
打开软件库,可以搜索或在终端输入software-center如果没有,可能没有安装软件库,可以在终端安装:sudo apt-get install software-center[注意全部小写]使用 ...