【问题解决】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
相关推荐
muyun280025 分钟前
Docker 下部署 Elasticsearch 8 并集成 Kibana 和 IK 分词器
elasticsearch·docker·容器
T06205142 小时前
工具变量-5G试点城市DID数据(2014-2025年
大数据
向往鹰的翱翔2 小时前
BKY莱德因:5大黑科技逆转时光
大数据·人工智能·科技·生活·健康医疗
鸿乃江边鸟3 小时前
向量化和列式存储
大数据·sql·向量化
IT毕设梦工厂4 小时前
大数据毕业设计选题推荐-基于大数据的客户购物订单数据分析与可视化系统-Hadoop-Spark-数据可视化-BigData
大数据·hadoop·数据分析·spark·毕业设计·源码·bigdata
java水泥工4 小时前
基于Echarts+HTML5可视化数据大屏展示-白茶大数据溯源平台V2
大数据·echarts·html5
广州腾科助你拿下华为认证6 小时前
华为考试:HCIE数通考试难度分析
大数据·华为
在未来等你8 小时前
Elasticsearch面试精讲 Day 17:查询性能调优实践
大数据·分布式·elasticsearch·搜索引擎·面试
大数据CLUB11 小时前
基于spark的澳洲光伏发电站选址预测
大数据·hadoop·分布式·数据分析·spark·数据开发
ratbag67201311 小时前
当环保遇上大数据:生态环境大数据技术专业的课程侧重哪些领域?
大数据