【错误记录】Android Studio 向 GitHub 提交代码报错 ( Push failed: Failed with error: Could not read | 使用命令行提交代码 )

简介: 【错误记录】Android Studio 向 GitHub 提交代码报错 ( Push failed: Failed with error: Could not read | 使用命令行提交代码 )

文章目录

一、报错信息

二、解决方案





一、报错信息


在 Android Studio 中首次向 GitHub 提交代码 , 报错 :


Push failed: Failed with error: Could not read from remote repository.

image.png







二、解决方案


如果在 Android Studio 中使用可视化界面提交失败 ;


image.png


考虑使用 Git 命令提交 ;


进入 Terminal 面板 , 进入工程根目录 , 执行如下命令 , 即可向 GitHub 提交代码 ;


git push --set-upstream origin master



完整过程 :


Microsoft Windows [版本 10.0.19041.1288]
(c) Microsoft Corporation。保留所有权利。
Y:\002_WorkSpace\001_AS\VA_Original\VirtualApp-master\VirtualApp>git status
On branch master
nothing to commit, working tree clean
Y:\002_WorkSpace\001_AS\VA_Original\VirtualApp-master\VirtualApp>git push
fatal: The current branch master has no upstream branch.
To push the current branch and set the remote as upstream, use
    git push --set-upstream origin master
Y:\002_WorkSpace\001_AS\VA_Original\VirtualApp-master\VirtualApp>git push --set-upstream origin master
The authenticity of host 'github.com (52.74.223.119)' can't be established.
RSA key fingerprint is SHA256:nThbg6kXUpJWGl7E1IGOCspRomTxdCARLviKw6E5SY8.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'github.com,52.74.223.119' (RSA) to the list of known hosts.
Enumerating objects: 1239, done.
Counting objects: 100% (1239/1239), done.
Delta compression using up to 12 threads
Compressing objects: 100% (1156/1156), done.
Writing objects: 100% (1239/1239), 1.90 MiB | 908.00 KiB/s, done.
Total 1239 (delta 213), reused 0 (delta 0)
remote: Resolving deltas: 100% (213/213), done.
To github.com:han1202012/VirtualApp.git
 * [new branch]      master -> master
Branch 'master' set up to track remote branch 'master' from 'origin'.
Y:\002_WorkSpace\001_AS\VA_Original\VirtualApp-master\VirtualApp>


image.pngimage.png



GitHub 显示代码提交完成 ;


image.png


UI 可视化提交失败 , 可以考虑使用命令提交代码 ;


目录
相关文章
|
Android开发 Windows
Android studio 报错Connect to 127.0.0.1:8888 [/127.0.0.1] failed: Connection refused: connect(已解决)
这是一篇关于解决Android Studio报错“Connect to 127.0.0.1:8888 failed: Connection refused”的文章。问题通常因系统代理设置被Android Studio自动保存导致。解决方法是找到系统中Android Studio使用的gradle.properties文件(位于Windows的C:\Users\你的电脑用户名\.gradle或Mac的/Users/.{你的用户目录}/.gradle),删除或注释掉多余的代理配置后保存并重新Sync项目。希望此经验能帮助快速解决同类问题!
2623 36
|
11月前
|
人工智能 自然语言处理 安全
Milvus x n8n :自动化拆解Github文档,零代码构建领域知识智能问答
本文介绍了在构建特定技术领域问答机器人时面临的四大挑战:知识滞后性、信息幻觉、领域术语理解不足和知识库维护成本高。通过结合Milvus向量数据库和n8n低代码平台,提出了一种高效的解决方案。该方案利用Milvus的高性能向量检索和n8n的工作流编排能力,构建了一个可自动更新、精准回答技术问题的智能问答系统,并介绍了部署过程中的可观测性和安全性实现方法。
1268 0
|
11月前
|
存储 人工智能 自然语言处理
让你拥有一个AI大脑,这个32.1k Github项目是你不错的选择,支持PDF、Markdown、代码、视频成为你的知识内容
Quivr 是开源全栈 RAG 平台,助你打造“第二大脑”,支持多文档类型与多种 LLM,实现智能搜索与聊天。具备语义检索、本地部署、隐私保护等功能,适用于个人知识管理与企业知识库,界面简洁易用,是高效智能问答的理想选择。
637 0
|
JSON JavaScript API
MCP 实战:用配置与真实代码玩转 GitHub 集成
MCP 实战:用配置与真实代码玩转 GitHub 集成
2851 4
GitHub-cli应用:使用GH命令行在本地提交issue、PR并合并PR。
使用GitHub CLI,你可以更专注于编写和阅读代码,而不需要为了简单的操作反复跳转页面。在这个充满终端、代码和开源的世界中,让GitHub CLI被你牢牢掌握,在你的掌中,它将会是一个强大的工具。
677 19
|
Devops Shell 网络安全
git使用之如何将一套代码同时推送至github|gitee|gitcode|gitlab等多个仓库-含添加ssh-优雅草央千澈完美解决-提供整体提交代码
git使用之如何将一套代码同时推送至github|gitee|gitcode|gitlab等多个仓库-含添加ssh-优雅草央千澈完美解决-提供整体提交代码
869 16
git使用之如何将一套代码同时推送至github|gitee|gitcode|gitlab等多个仓库-含添加ssh-优雅草央千澈完美解决-提供整体提交代码
|
人工智能 网络安全 开发工具
vscode代码推送到github库菜鸡专用教程
vscode代码推送到github库菜鸡专用教程
|
网络安全 开发工具 git
解决fatal:remote error:You can’t push to git://github.com/username/*.g
通过上述诊断与修复步骤,绝大多数的推送错误都能得到有效解决,确保您的Git工作流顺畅无阻。
840 1
|
Shell 网络安全 开发工具
【错误记录】Android Studio 向 GitHub 提交代码报错 ( Push failed: Failed with error: Could not read from remote )
【错误记录】Android Studio 向 GitHub 提交代码报错 ( Push failed: Failed with error: Could not read from remote )
407 0
【错误记录】Android Studio 向 GitHub 提交代码报错 ( Push failed: Failed with error: Could not read from remote )
|
9月前
|
移动开发 前端开发 Android开发
【02】建立各项目录和页面标准化产品-vue+vite开发实战-做一个非常漂亮的APP下载落地页-支持PC和H5自适应提供安卓苹果鸿蒙下载和网页端访问-优雅草卓伊凡
【02】建立各项目录和页面标准化产品-vue+vite开发实战-做一个非常漂亮的APP下载落地页-支持PC和H5自适应提供安卓苹果鸿蒙下载和网页端访问-优雅草卓伊凡
1698 12
【02】建立各项目录和页面标准化产品-vue+vite开发实战-做一个非常漂亮的APP下载落地页-支持PC和H5自适应提供安卓苹果鸿蒙下载和网页端访问-优雅草卓伊凡