【问题解决】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
相关推荐
2601_956139425 分钟前
文旅行业品牌全案公司哪家强
大数据·人工智能·python
生活观察站5 分钟前
中文在线亮相横琴—澳门国际数字艺术博览会国际数字创意论坛:AI漫剧打开内容创作新想象
大数据·人工智能
地球资源数据云30 分钟前
1900-2023年中国物种分布点位矢量数据集
大数据·数据结构·数据库·数据仓库·人工智能
菜鸟小码32 分钟前
MapReduce 真正的核心之Shuffle 阶段深度解析:分区、排序、合并与归约
大数据·mapreduce
Vwms1 小时前
2026 医药制造 WMS 选型指南:GMP 合规仓储管理系统怎么选
大数据·wms·wms选型
精益数智工坊1 小时前
拆解制造业仓库物料管理流程:如何通过标准化仓库物料管理流程解决账实不符难题
大数据·前端·数据库·人工智能·精益工程
GUET_一路向前1 小时前
【git工作常用指令】
大数据·git·elasticsearch
烟台业荣数据科技有限公司1 小时前
智能建造:从“能做”到“值得做”,我们还需跨越什么?
大数据·人工智能
学掌门1 小时前
数据分析师初级—中级—高级,每个阶段都需要学习什么?
大数据·学习·数据分析·数据分析师
财迅通Ai1 小时前
满坤科技:业绩稳健增长,ESG治理成效凸显
大数据·人工智能·科技·满坤科技