git问题小结

本文介绍了使用Git过程中常见的几个问题及其解决方案,包括如何处理.gitignore文件不起作用的情况、解决提交时提示未设置用户信息的问题以及如何配置Git使其正确显示中文路径等。此外,还提供了一种设置全局忽略文件的方法。

1. .gitignore不起作用的原因是需要忽略的文件在缓存中。

处理方法如下:

git清除本地缓存命令如下:

git rm -r --cached .
git add .
git commit -m 'update .gitignore'

 

2. git commit 时出现了Please tell me who you are

解决方法如下:

git config --global user.email "邮箱名称"

git config --global user.name "用户名"

3. git bash无法识别中文的解决方法

解决方法如下:

git config --global core.quotepath false

git config --global core.pager more

参考https://www.cnblogs.com/Java-Script/p/11095468.html

4. 全局忽略文件:

A.  vi ~/.gitignore_global

B. 写入

.DS_Store

*/.DS_Store

C. git config --global core.excludesfile ~/.gitignore_global

参考https://www.jianshu.com/p/e3d8eb2a4295

 

 

 

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值