git - 将现有的 Android Studio 项目添加到现有的 GitHub 存储库
问题描述
我在 Android Studio 中创建了一个项目新项目,我想将它添加到当前为空的现有 GitHub 存储库中。
我已经尝试过这个问题的答案:Replace GitHub repository with a new Android Studio project while reserved old commits
但是一旦我进入决赛,git push
我就会收到一条错误消息fatal: No configured push destination.
我也试过https://github.community/t5/How-to-use-Git-and-GitHub/How-to-link-an-existing-Android-Studio-Project-to-an-existing/td- p/1946但这会将项目上传到错误的 GitHub 帐户。我有两个 GitHub 帐户,我认为这是这个解决方案的问题,我已经注销了我不需要的帐户。
还有其他方法可以连接到现有的 GitHub 存储库吗?
解决方案
很可能您忘记添加遥控器。您可以使用以下命令检查远程列表。
git remote -v
如果不存在来源,请尝试使用以下命令添加遥控器:
git remote add <remote name> <remote url>
(远程 url 是你的仓库 url,例如:https://github.com/user/repo.git)
然后您可以使用以下命令推送:
git push <remote name> <your branch name>
推荐阅读
- python - Flask 文件上传到唯一目录
- java - 计划任务导致 OutOfMemoryError (Spring Boot)
- odata - 使用 PowerBI desktop / excel 访问受 Azure B2C 保护的 odata 源
- reference - Azure 中 Web 应用的负载平衡
- c - 如何打印动态数组书籍 * arr
- python - 如何创建一个查询?
- javascript - 在我的 ajax 请求上添加条件(if 和 else)
- apache-spark - 关于 Spark 中数据局部性的一个问题
- azure - 逻辑应用子文件夹触发器
- python - python中有没有像Arduino的millis()这样的函数?