我一直在查看有关如何执行此操作的一些指南,但我尝试过的任何方法都不起作用。到目前为止我做了什么:
- 已下载 git for windows
- 在 android studio 中启用版本控制 -> 选择 git -> 将其指向 git.exe
- 点击“测试”,一切正常
这是我感到困惑的时候。我现在必须通过 git bash 手动添加 Remote ,所以我打开了一个 bash 提示符,但我不确定在那里输入什么。我试过类似的东西:
git remote add origin https://github.com/[用户名]/[项目名].git
git remote add origin git@github.com:[用户名]/[项目名].git
对于这两个,我都收到错误消息“fatal: remote origin already exists”
如果这些已经存在,那么为什么我在我的 github 帐户上看不到该项目?我试图通过 android studio 进行初步推送,但我仍然没有看到任何东西。此外,当我通过 android studio 推送时,就好像一切都很好,我没有收到任何错误消息。
最佳答案
你已经创建了 origin 作为远程,只需使用 git add 将你的东西添加到暂存区。
然后使用 git commit -m 'your commit message'
到提交您的更改,然后是最重要的部分,PUSH 使用 git push origin master
您的 master 分支到您的远程。
您应该在此处阅读有关 git 工作流程的信息:http://git-scm.com/book/en/Getting-Started-Git-Basics , http://marklodato.github.io/visual-git-guide/index-en.html .
关于android - 如何将我的项目从 Android Studio 添加到我的 GitHub 页面?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23330825/