【问题解决】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
相关推荐
大大大大晴天3 小时前
每天认识一个组件:VictoriaLogs
大数据
2601_967979124 小时前
图书恐惧症者的福音,Python官方文档使用指南
搜索引擎·基础语法·快速搜索·使用指南·python官方文档
学长毕设6 小时前
基于SpringBoot 博物馆文物租赁及修复管理系统-附源码
大数据·数据库·spring boot
玖米GEO运营王总监8 小时前
成都AI数字人视频怎么批量生产?流程与合规标注
大数据·人工智能·音视频
龙腾AI白云9 小时前
数字孪生与计算机视觉:让机器看懂现场
大数据·数据库·机器学习·知识图谱·pygame
starzy199012 小时前
Structured Streaming 案例剖析:一个 8 万 QPS 实时大屏的完整落地与三次线上事故复盘
大数据·spark
大大大大晴天1 天前
浅聊维度建模中的星型模型与雪花模型
大数据
数字新视界1 天前
能耗管理系统提升企业能源效率的实践与展望
大数据·人工智能·数据中心·机房管理·模块化机房
大大大大晴天1 天前
别让金额越算越多:事实表与维度表设计避坑指南
大数据
如夏倾城1 天前
入侵检测系统(IDS)原理、部署模式与 IPS/防火墙对比
大数据·网络·人工智能·网络安全·云原生·架构·kubernetes