【问题解决】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
相关推荐
云上先途12 小时前
属性标注是什么?主要解决什么问题?
大数据·人工智能
大大大大晴天15 小时前
每天认识一个组件:元数据平台OpenMetadata
大数据
接口不宕机15 小时前
1688 商品列表 API 对接商家 ERP,实现店铺商品同步与上下架自动监控
大数据
河南花仙子科技17 小时前
企业定制小游戏助力品牌软性传播
大数据·科技·游戏·小程序
云上先途17 小时前
标签化服务适合哪些人?常见适用场景一次讲清
大数据·人工智能·算法·音视频
yt004yt17 小时前
### 越华环保集团|绿岛 VOCs 集中治理,管网系统安全设计工程实战分享
大数据·运维
GreatVicent18 小时前
腾讯AI产业大会解读:Agent进场,企业基础设施怎么搭
大数据·数据库·人工智能·llm·agent·企业信息化
m0_4665252918 小时前
从火柴人看护画面看云从科技生态企业的隐私保护实践
大数据·人工智能·科技·microsoft
yt004yt18 小时前
越华环保集团|绿岛 VOCs 集中治理,管网系统安全设计工程实战分享
大数据·运维
sxwuyanzu18 小时前
DeepSeek冲IPO-谁在为它付钱-公众号发布稿
大数据·人工智能·科技