【问题解决】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的同事修改后台配置返回错误信息才查到的,这里仅提供个解决思路一般遇到该问题基本可解决。

相关推荐
console.log('npc')7 小时前
Git 冲突与 AI 协助指南
前端·人工智能·git·大模型
重生之我来学Python15 小时前
Git-SVN 混合开发,从入门到精通!
开发语言·git·svn·github
笨笨饿17 小时前
#137_死机恢复现场_Armino平台AP系统swd调试
git·python·stm32·单片机·嵌入式硬件·物联网·vim
King of fraud18 小时前
Git 入门:从零开始的版本控制之旅
git
AI大模型-小华18 小时前
Codex CLI第一次怎么用?从安装到读取本地项目完整教程
git·node.js·ai编程·开发工具·代码分析·codex·codex cli
2401_8616786218 小时前
Git 在 Windows 使用
windows·git·elasticsearch
青禾83721 小时前
Git 与 SVN 完全指南:从集中式到分布式的版本控制
分布式·git·svn
2301_800954991 天前
Git 版本控制核心概念详解:从集中式到分布式
分布式·git
Draw Stars1 天前
Git BASH安装教程
开发语言·git·bash
Akiyama_Mio-Kon1 天前
2026 最新:Dify 本地 Docker 部署完整教程(Windows + Git Bash)
windows·git·docker