怎么解决 fatal: destination path . already exists and is not an empty directory.?

Git Clone 的时候提示目录下存在文件


报错信息为:fatal: destination path '.' already exists and is not an empty directory.

1、常用的方法就是把目录下的文件删除,然后重新 git clone ,就可以重新拉取线上的库下来。

2、如果是需要把本地代码上传到线上。执行已下流程即可。

git init #初始化
git remote add origin (address) # 添加远程仓库地址
git add .                       # “.” 表示添加本地所有代码
git commit -m "init"            # 添加这次提交的备注信息
git push origin master          # 提交到远程仓库

注:

如出现错误:

 ! [rejected]        master -> master (fetch first)
error: failed to push some refs to 'codeup.*************.git'

解决方案:

运行,合并后,在执行 git push

git pull --rebase origin master


文章来源地址https://www.toymoban.com/diary/git/70.html

到此这篇关于怎么解决 fatal: destination path . already exists and is not an empty directory.?的文章就介绍到这了,更多相关内容可以在右上角搜索或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!

原文地址:https://www.toymoban.com/diary/git/70.html

如若转载,请注明出处: 如若内容造成侵权/违法违规/事实不符,请联系站长进行投诉反馈,一经查实,立即删除!

领支付宝红包 赞助服务器费用
未经允许不得转载:Toy模板网 » 怎么解决 fatal: destination path . already exists and is not an empty directory.?
上一篇 2023年08月19日 16:43
下一篇 2023年08月19日 16:43

相关文章

  • 解决Git 报错:fatal: destination path ‘xxx‘ already exists and is not an empty directory

    拿到开发的Git地址,然后Git clone的时候,检测不出东西,只有一个.git目录,实际无东西。 可手动删除,或执行下面命令 然后再执行检出命令 熟悉 linux 命令都知道 rm -rf .git 命令会删除当前目录的 git 记录,如果没有把握的话,最好还是新建一个目录,比如xxx 目录,命令如下

    2024年02月05日
    浏览(28)
  • 文件上传gitee中出现问题fatal: remote origin already exists.(远程来源已存在) 解决方法

    当我们在上传文件到gitee中的时候,输入git remote add origin git@toscode.gitee.com:jiemengjie(码云账号)/vue3-project(自己创建的仓库名).git后,会出现一句话 fatal: remote origin already exists.远程来源已存在。 如下图所示: 这时候我们可以输入命令  git remote -v ,意思是列出所有的远程仓

    2024年02月04日
    浏览(30)
  • github想传至远程仓库显示fatal: remote origin already exists. (远程来源已经存在 解决办法)

    参考:https://blog.csdn.net/qq_40428678/article/details/84074207 在当我们输入 git remote add origin https://gitee.com/(github/码云账号)/(github/码云项目名).git 就会报如下的错 fatal: remote origin already exists. 翻译过来就是:致命:远程来源已经存在 此时,我们可以先 git remote -v 查看远程库信息: 可以看

    2024年02月07日
    浏览(22)
  • 解决fatal: No configured push destination.

    问题:git push时,出现fatal: No configured push destination. 原因:推送至远程仓库时,缺少目标仓库地址 解决方法: 1、添加远程仓库地址: 2、 推送本地代码至远程仓库分支 不会调试运行的同学,你只需打开远程,会帮你搭建调试好一切(JDK、Idea/Eclipse、MySQL、Tomcat、Maven………)

    2024年02月11日
    浏览(15)
  • MySQL安装中出现的The selected path already exists以及Connector/Python ***以及start service MySQL80 Failed

    近因为学习Python需要用到数据库,选择了MySQl去应用安装,但是安装失败一直困扰着我。可能 也是因为报错的details太多很麻烦所以不想仔细看吧。这几天搞下来也有点心得和大家分享一下。 意思是说你已经创建了文件夹(安装过程会自动创建),我们只需要找到位置给删除

    2024年02月15日
    浏览(26)
  • Linux下swap file “*.swp”already exists!解决方法

    问题: 在 Linux 下的 vim 编辑过程中,由于某种原因异常退出正在编辑的文件,再次编辑该文件时,会出现如下提示: [O]pen Read-Only, (E)dit anyway, ®ecover, (D)elete it, (Q)uit, (A)bort: 原因: 使用vim编辑文件实际是先copy一份临时文件并映射到内存给你编辑, 编辑的是临时文件, 当执行

    2024年02月11日
    浏览(20)
  • 解决Linux报错:Swap file “xxxxxx.swp“ already exists

    出现问题 Swap file “.models_conf.yaml.swp” already exists! 在 Linux 下 vim 编辑过程中,由于某种原因异常退出正在编辑的文件,再次编辑该文件时,会出现如下提示: 一个文件出现了带有.swp的副本文件的时候,会出现如下提示: 问题出现原因分析 出现类似问题的时候必须好好读提

    2024年02月11日
    浏览(23)
  • HDFS Browse Directory目录显示 Path does exist on HDFS or WebHDFS is disabled.

        在hadoop中新建目录 HDFS系统中Browse Directory目录显示 Path does not exist on HDFS or WebHDFS is disabled. Please check your path or enable WebHDFS  这里的/usr/dfstest并不是linux主机上的/usr目录,而是hadoop系统中的/usr目录,查看hadoop系统上是否有这个目录 可以看到,我的hadoop系统上,创建的目录

    2024年02月12日
    浏览(24)
  • git 报错 error: remote origin already exists 解决与代码上传到远程 gitee 仓库

    当你git clone 别人的代码时,想推送到自己的仓库可能遇到如下问题: error: remote origin already exists.表示远程仓库已存在。 执行以下操作即可: 1、git remote -v 查看项目关联的远程库地址 2、先输入git remote rm origin 删除关联的 origin 的远程库 3、关联自己的仓库 git remote add origin

    2024年02月04日
    浏览(22)
  • 【云原生】docker-compose安装,解决Warning: the “docker“ command appears to already exist on this system.3的问题

    https://docs.docker.com/compose/compose-file/compose-file-v3/ 参考:https://github.com/docker/compose/releases 国内源安装(不推荐): 查看版本: 出现以下问题: appears to already exist on this system. If you already have Docker installed, this script can cause trouble, which is why we’re displaying this warning and provide the opp

    2023年04月09日
    浏览(25)

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

博客赞助

微信扫一扫打赏

请作者喝杯咖啡吧~博客赞助

支付宝扫一扫领取红包,优惠每天领

二维码1

领取红包

二维码2

领红包