文档首页>
代码托管 CodeArts Repo>
常见问题>
常见报错解决方法>
destination path 'XXX' already exists and is not an empty directory
更新时间:2023-08-28 GMT+08:00
destination path 'XXX' already exists and is not an empty directory
问题现象
从云端克隆代码时,提示“destination path 'XXX' already exists and is not an empty directory”。
原因分析
所克隆的代码仓库已存在并且不为空。
处理方法
克隆项目至新目录。
- 进入目录:
cd 本地代码仓库目录
- 克隆云端代码仓库到临时目录tmp中:
git clone --no-checkout 云端代码仓库地址tmp
- 将tmp目录下的 .git 目录移到当前目录:
mv tmp/.git 本地代码仓库目录名
- 删除tmp目录:
rmdir tmp
- 回退至上个版本:
git reset --hard HEAD
父主题: 常见报错解决方法
常见报错解决方法 所有常见问题
- 私钥丢失
- 此密钥已存在,请重新生成密钥
- 使用SSH协议克隆代码时一直提示输入密码
- 使用HTTPS方式克隆代码时,输入登录密码报错
- 提交代码之后,仓库找不到文件
- pathspec XXX did not match any files
- Transport Error: cannot get remote repository refs. XXX.git: cannot open git-upload-pack
- syntax error near unexpected token `newline'
- unable to auto-detect email address
- fatal:Authentication failed
- 'origin' does not appear to be a git repository
- You are not allowed to push code to protected branches on this project
- Not a git respository
- src refspec master does not match any
- destination path 'XXX' already exists and is not an empty directory
- The requested URL returned error: 401
- 向代码仓库推送代码失败
- 使用git pull拉取代码失败
- fatal: refusing to merge unrelated histories
- SSL certificate problem
more