【问题解决】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
相关推荐
B站_计算机毕业设计之家22 分钟前
计算机毕业设计:Python农业数据可视化分析系统 气象数据 农业生产 粮食数据 播种数据 爬虫 Django框架 天气数据 降水量(源码+文档)✅
大数据·爬虫·python·机器学习·信息可视化·课程设计·农业
失散131 小时前
分布式专题——43 ElasticSearch概述
java·分布式·elasticsearch·架构
Apache Flink2 小时前
Flink Agents 0.1.0 发布公告
大数据·flink
潘达斯奈基~4 小时前
在使用spark的applyInPandas方法过程中,遇到类型冲突问题如何解决
大数据·笔记
火星资讯5 小时前
腾多多数字零售模式:从成本转嫁到全生态共赢的破局实践
大数据
望获linux5 小时前
【实时Linux实战系列】实时 Linux 的自动化基准测试框架
java·大数据·linux·运维·网络·elasticsearch·搜索引擎
金宗汉6 小时前
《宇宙递归拓扑学:基于自指性与拓扑流形的无限逼近模型》
大数据·人工智能·笔记·算法·观察者模式
直有两条腿6 小时前
【数据迁移】HBase Bulkload批量加载原理
大数据·数据库·hbase
Joy T6 小时前
海南蓝碳:生态财富与科技驱动的新未来
大数据·人工智能·红树林·海南省·生态区建设
风清再凯7 小时前
01-ELK安装ES,ES-head
大数据·elk·elasticsearch