Git 配置及提交步骤(自用版)

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
//再次查看状态

  • 1
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值