[Github] 本地git push免用户名和密码的配置
2024-09-26 19:27:12
在终端通过git config --global命令进行配置
git config --global user.email "xxx@xxmail.com"
git config --global user.name "xxx"
git config --global credential.helper store # git push的时候记住用户名和密码
git config --global push.default simple #从Git .0之后,push.default的默认值由'matching'改为'simple'
这几个命令实际上在操作用户目录下的.gitconfig文件, 其内容如下:
$ cat ~/.gitconfig
[user]
email = xxx@xxmail.com
name = xxx
[credential]
helper = store
[push]
default = simple
另外,如果没有配置push.default这一项,git push的时候会提示以下信息,可以看到matching方式和simple方式的区别:
warning: push.default is unset; its implicit value has changed in
Git 2.0 from 'matching' to 'simple'. To squelch this message
and maintain the traditional behavior, use: git config --global push.default matching To squelch this message and adopt the new behavior now, use: git config --global push.default simple When push.default is set to 'matching', git will push local branches
to the remote branches that already exist with the same name. Since Git 2.0, Git defaults to the more conservative 'simple'
behavior, which only pushes the current branch to the corresponding
remote branch that 'git pull' uses to update the current branch. See 'git help config' and search for 'push.default' for further information.
(the 'simple' mode was introduced in Git 1.7.. Use the similar mode
'current' instead of 'simple' if you sometimes use older versions of Git)
参考:
最新文章
- JS处理四舍五入函数 toFixed(n)(可取小数点后n位)
- Apache配置文件服务器
- centos apache源码安装过程记录
- App开发流程之Xcode配置和本地化
- Nginx源码安装及调优配置
- python保留指定文件、删除目录其他文件的功能(1)
- 【LeetCode题意分析&;解答】37. Sudoku Solver
- 【C语言探索之旅】 第二部分第一课:模块化编程
- Javaweb项目开发的前后端解耦的必要性
- C#之FTP上传下载(二)
- delphi
- Chapter 4 Invitations——8
- Android SharedPreferences增,删,查操作
- shell脚本总结
- StringBuffer类和String类(原文地址 : http://www.cnblogs.com/springcsc/archive/2009/12/03/1616330.html)
- centos 7 安装 BeautifulSoup 和requests
- [IIS | 用户权限] Connect as... 的设置
- yum安装lnmp
- Python_03-数据类型
- Codeforces 959 F. Mahmoud and Ehab and yet another xor task
热门文章
- visual studio中添加existing web site, website名字附带数字
- Putting Apache Kafka To Use: A Practical Guide to Building a Stream Data Platform-part 2
- [Linux]pycharm在Linux环境下安装
- 【python】argparse学习(转)
- mysql_fetch_assoc查询多行数据
- harbor 管理Helm Chart包
- 【转】asp.net 项目在 IE 11 下出现 “__doPostBack”未定义 的解决办法
- e.target和e.currentTarget区别
- [postgreSql]postgreSql数据库、模式、表、函数的删除与创建
- [Vue]Vue实例的选项props传递数据props为驼峰式命名