git配置
1.配置用户名(提交时会引用)
git config --global user.name “自己的用户名”
2.配置邮箱(提交时会引用)
git config --global user.email “自己的邮箱”
3.其他配置
git config --global core.autocrlf false
让Git不要管windows/unix换行符转换的事
4.编码配置
git config --global gui.encoding utf-8
避免git gui中的中文乱码
git config --global core.quotepath off
避免git status显示的中文文件名乱码
Windows上还需要配置
git config --global core.ignorecase false
5.git ssh key pair配置
ssh-keygen -t rsa -C “自己的邮箱”
一路回车
ssh-add ~/.ssh/id_rsa (如果执行这个命令时出现Could not open a connection to your authentication agent,则先执行eval ssh-agent
(注:`为~键上的那个),然后在执行ssh-add ~/.ssh/id_rsa)
6.生成的密钥复制,粘贴到码云或者github中即可
https://gitee.com/galvin2my/template_cli3.git
git提交步骤
**1.git status
**//查看修改了什么文件
2.git pull
//拉取远程仓库新的代码
3.git status
//查看是否有冲突,如果有冲突,手动解决,解决完之后,然后再
4.git add .
//添加变更的文件
5.git commit -am "比如解决冲突 "
//引号中描述当次提交
6.git push
//推送到远程仓库
7.git status
//再次查看状态