【问题解决】Git命令行常见error及其解决方法

以下是我一段时间没有使用xshell,然后用git命令行遇到的一些系列错误和他们的解决方法

遇到了这个报错:

fatal: Not a git repository (or any of the parent directories): .git

我查阅一些博客和资料,可以解决的方式:

复制代码
git init

在我进行git push提交文件时,我遇到了下面这个报错

复制代码
fatal: No configured push destination.
Either specify the URL from the command-line or configure a remote repository using

    git remote add <name> <url>

and then push using the remote name

    git push <name>

解决方式:

复制代码
 git remote add origin 'http://git.....'
 git push -u origin master

出现了这个报错:

解决方式:

复制代码
git pull --rebase origin master

遇到的报错:

复制代码
error: The following untracked working tree files would be overwritten by checkout

解决方式:

复制代码
git clean -d -fx

遇到的报错:

复制代码
** Please tell me who you are.

Run
  git config --global user.email "you@example.com"
  git config --global user.name "Your Name"

to set your account's default identity.
Omit --global to set the identity only in this repository.

fatal: unable to auto-detect email address (got 'lvyp@NEU-20190128LYP.(none)')

解决方式:

意思是说你在创建本地仓库时未定义用户名和邮箱,此时再按照错误提示,利用

复制代码
git config --global user.name "follow"
git config --global user.email "follow@qq.com"

再跟上一句

复制代码
git config --local -l
相关推荐
生活皆是风景7 分钟前
抢占AI采信,问答布局正当时
大数据·安全·搜索引擎
生态学者14 分钟前
Journal of Applied Ecology | 华南植物园王法明研究员团队揭示加纳红树林蓝碳储量及其环境调控机制
大数据·r语言·微信公众平台
晓天衡宇•评测社区22 分钟前
大语言模型 8 月榜单更新:Claude Opus 5 登顶,Gemini 3.6-Flash 与 DeepSeek-V4 Flash 展现差异化优势
大数据·人工智能
aiqianzhan29 分钟前
采购数字化选型:智慧采购平台五维对照与常见路线
大数据·人工智能
2603_9651481131 分钟前
eBay商品数据API:寻找海外仓与价格洼地
大数据·人工智能·windows·python·microsoft
Web3_Daisy10 小时前
Pump.fun 与 FOMO 竞争背后的 Meme 市场变局
大数据·人工智能·金融·web3·区块链
论文避坑指南12 小时前
论文写作全流程AI合规边界:从选题到投稿的“红绿灯“清单
大数据·人工智能·深度学习
V哥AI增长13 小时前
Schema.org 结构化数据与GEO技术落地:AI引擎引用机制与JSON-LD部署实证研究
大数据·运维·人工智能
嘉禾望岗50313 小时前
datagrip连接带有kerberos认证的hive
大数据·kerberos
爱吃面的猫15 小时前
大数据Kafka3.x之——Kafka3.3.0安装与使用(详细)
大数据·分布式·zookeeper