【问题解决】remote: parse error: Invalid numeric literal at line 1, column 20,解决思路

问题现象

某同事出现过同样的推送到git仓库报错的问题,报错信息详情如下:

bash 复制代码
Delta compresion using up to 20 threads
Compressing objects: 100%(4/4), done.
Writing objects: 100%(5/5), 521 bytes | 521.00 KiB/s, done.
Total 5 (delta 3), reused 0 (delta 0), pack-reused 0
remote: parse error: Invalid numeric literal at line 1, column 20
To http://域名/gitlab/仓库.git
![remote reiected] dev -> dev (pre-receive hook declined)
error: failed to push some refs to http://域名/gitlab/仓库.git

重点关注到 remote: parse error: Invalid numeric literal at line 1, column 20 查询解决方案发现大部分都在说git的推送命令后置脚本之类的问题,

排查过两次均未发现问题,重新clone并初始化用户配置后一切正常,问题出现在该同事自行clone后再作提交才会出现问题。

排查结果

这个问题常见于 git config 命令配置用户信息,如用户名、邮箱等写入错误的字符,如本例中该同事配置邮箱时将邮箱前后均加了中文双引号导致问题。

排查思路

从git config 入手,检查用户名与邮箱设置是否有中文字符等异常:

bash 复制代码
git config user.name
git config user.email

如果有异常,重新设置即可。

bash 复制代码
git config user.name xxxx
git config user.email [email protected]

PS: 问题排查是负责gitlab的同事修改后台配置返回错误信息才查到的,这里仅提供个解决思路一般遇到该问题基本可解决。

相关推荐
它说我会飞耶7 小时前
git 命令集
git
极小狐7 小时前
极狐GitLab 合并请求依赖如何解决?
运维·git·ssh·gitlab·github
ikkkkkkkl11 小时前
Git基本操作
git
互联网搬砖老肖12 小时前
git 的基本使用
大数据·git·elasticsearch
程序猿chen14 小时前
量子跃迁:Vue组件安全工程的基因重组与生态免疫(完全体终局篇)
前端·vue.js·git·安全·面试·前端框架·跳槽
SunTecTec15 小时前
Idea 配置 Git
git
chxii16 小时前
2.4.5goweb项目上传到csdn的git仓库
git
清风徐来QCQ16 小时前
git和github的使用指南
git·github
serene9417 小时前
IntelliJ IDEA 2025.2 和 JetBrains Rider 2025.1 恢复git commit为模态窗口
java·git·intellij-idea
sun00770018 小时前
git 工具
git