【错误记录】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 可视化提交失败 , 可以考虑使用命令提交代码 ;


目录
相关文章
|
7月前
|
网络协议 开发工具 git
解决 git 报错 “fatal: unable to access ‘https://github.com/.../.git‘: Recv failure Connection was rese
在使用 Git/Git小乌龟 进行代码管理的过程中,经常会遇到各种各样的问题,其中之一就是在执行 git clone 或 git pull 等操作时出现 “fatal: unable to access ‘https://github.com/…/.git’: Recv failure Connection was reset” 的报错。这个问题通常是由网络连接问题或代理设置不正确导致的。在我的个人使用经验中,我亲自尝试了四种方法,它们都能够有效地解决这个报错。个人比较推荐方法二。
5154 1
|
10月前
GitHub-cli应用:使用GH命令行在本地提交issue、PR并合并PR。
使用GitHub CLI,你可以更专注于编写和阅读代码,而不需要为了简单的操作反复跳转页面。在这个充满终端、代码和开源的世界中,让GitHub CLI被你牢牢掌握,在你的掌中,它将会是一个强大的工具。
277 19
|
存储 开发者
GitHub CLI - 将GitHub带入命令行
本文介绍了 GitHub CLI(命令行界面)的基本概念及其主要功能,重点讲解如何通过命令行管理 GitHub 上的问题和拉取请求。文章详细列出了与问题和拉取请求相关的常用命令,包括列出、查看、创建和检查状态等操作,旨在帮助开发者提高工作效率,优化日常开发流程。
494 2
GitHub CLI - 将GitHub带入命令行
|
Android开发 Docker 容器
docker中编译android aosp源码,出现Build sandboxing disabled due to nsjail error
在使用Docker编译Android AOSP源码时,如果遇到"Build sandboxing disabled due to nsjail error"的错误,可以通过在docker run命令中添加`--privileged`参数来解决权限不足的问题。
2767 1
|
数据安全/隐私保护
github报错(完美解决):获取token。remote: Support for password authentication was removed on August 13, 2021.
这篇文章介绍了如何在GitHub上解决因密码认证被移除而导致的推送错误,通过创建和使用个人访问令牌(token)来代替密码进行身份验证。
3640 0
github下载的.ipynb文件报错unreadable Notebook NotJSONError
【8月更文挑战第2天】文章提供了解决GitHub下载的Jupyter Notebook文件打开时报错的方法,包括端口冲突和文件加载错误。
424 0
github下载的.ipynb文件报错unreadable Notebook NotJSONError
|
网络安全 开发工具 git
【git】解决git报错:ssh:connect to host github.com port 22: Connection timed out 亲测有效
【git】解决git报错:ssh:connect to host github.com port 22: Connection timed out 亲测有效
5825 1
|
开发工具 git
【已解决】error: failed to push some refs to ‘git@github.com:BATdalao/Github-green.git‘
【已解决】error: failed to push some refs to ‘git@github.com:BATdalao/Github-green.git‘
【完美解决】Github action报错remote: Write access to repository not granted.
【完美解决】Github action报错remote: Write access to repository not granted.
|
开发工具 git
出现“error: failed to push some refs to ‘https://github.com/****.git‘”,如何解决问题
出现“error: failed to push some refs to ‘https://github.com/****.git‘”,如何解决问题
2717 1

热门文章

最新文章