【问题解决】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
相关推荐
A 计算机毕业设计-小途10 分钟前
大四零基础用Vue+ElementUI一周做完化妆品推荐系统?
java·大数据·hadoop·python·spark·毕业设计·毕设
君不见,青丝成雪4 小时前
Flink双流join
大数据·数据仓库·flink
好好先森&6 小时前
Linux系统:C语言进程间通信信号(Signal)
大数据
EkihzniY6 小时前
结构化 OCR 技术:破解各类检测报告信息提取难题
大数据·ocr
吱吱企业安全通讯软件6 小时前
吱吱企业通讯软件保证内部通讯安全,搭建数字安全体系
大数据·网络·人工智能·安全·信息与通信·吱吱办公通讯
云手机掌柜6 小时前
Tumblr长文运营:亚矩阵云手机助力多账号轮询与关键词布局系统
大数据·服务器·tcp/ip·矩阵·流量运营·虚幻·云手机
rainFFrain8 小时前
Boost搜索引擎项目(详细思路版)
网络·c++·http·搜索引擎
Hello.Reader9 小时前
Elasticsearch Ruby 客户端安装与版本兼容指南
elasticsearch·jenkins·ruby
拓端研究室9 小时前
专题:2025全球消费趋势与中国市场洞察报告|附300+份报告PDF、原数据表汇总下载
大数据·信息可视化·pdf