【问题解决】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 xxxx@abc.com

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

相关推荐
℘团子এ4 小时前
git中,项目怎么更换远程仓库连接地址
git
言之。10 小时前
Git Hooks
git
代码AI弗森11 小时前
Git Bash 与 PowerShell:定位差异、使用场景与选择建议
开发语言·git·bash
森叶12 小时前
Git flow command error: ‘flow‘ is not a git command 问题解决
git
天麓14 小时前
git merge 举例
git
AI_567815 小时前
Git冲突治理白皮书:智能标记与可视化协同的下一代解决方案
大数据·人工智能·git·机器学习
念丶小宇15 小时前
Git常用指令
大数据·git·elasticsearch
CSDN_RTKLIB16 小时前
Git Clone
git
中二病码农不会遇见C++学姐16 小时前
.env 文件是干啥的?为什么不能提交到 Git?
git·学习
CoderJia程序员甲17 小时前
GitHub 热榜项目 - 日榜(2026-02-03)
git·ai·开源·llm·github