分类: Git

[Git]配置多用户信息

背景 苦于每个项目都要重新配置一遍用户名和邮箱,一不小心就把自己Github的用户信息推到公司的远仓上了,或者反过来。 解决方案 Git 2.13.0及以上版本提供了一 includeIf配置 方案一 使 includeIf匹配文件夹路径,然后指定生效的用户信息文件 我这里就不展示代码了(偷懒),网

[Git]配置多对密钥

1.首先生成多对密钥 ssh-keygen -t rsa -C "xxx@xx.com" -f ~/.ssh/id_rsa_x1 ssh-keygen -t rsa -C "xxx@xx.com" -f ~/.ssh/id_rsa_x2 2.~/.ssh目录下新建一 config文件 Host x

[Git]记一次ssh密钥配置的问题

新ssh客户端不支持ssh-rsa算法问题 报错 Unable to negotiate with xxxxxxx port 22: no matching host key type found. Their offer: ssh-rsa fatal: Could not read from re

[Git]新建并初始化项目

git init git remote add origin git@10.9.2.14:your-name/xxx.git git commit -m "Added login functionality"(`-m` 表示你将在命令行中提供提交消息) git push -u origin mast