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

16,307次阅读
没有评论

共计 842 个字符,预计需要花费 3 分钟才能阅读完成。

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

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

    正文完
     0
    Yojack
    版权声明:本篇文章由 Yojack 于1970-01-01发表,共计842字。
    转载说明:
    1 本网站名称:优杰开发笔记
    2 本站永久网址:https://yojack.cn
    3 本网站的文章部分内容可能来源于网络,仅供大家学习与参考,如有侵权,请联系站长进行删除处理。
    4 本站一切资源不代表本站立场,并不代表本站赞同其观点和对其真实性负责。
    5 本站所有内容均可转载及分享, 但请注明出处
    6 我们始终尊重原创作者的版权,所有文章在发布时,均尽可能注明出处与作者。
    7 站长邮箱:laylwenl@gmail.com
    评论(没有评论)