如何将我的项目从 Android Studio 添加到我的 GitHub 页面? [英] How do I add my project from Android Studio to my GitHub page?

查看:49
本文介绍了如何将我的项目从 Android Studio 添加到我的 GitHub 页面?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我一直在查看有关如何执行此操作的一些指南,但我尝试过的任何方法都不起作用.到目前为止我所做的:

I've been looking at some guides on how to do this but nothing I've tried is working. What I've done so far:

  • 已下载适用于 Windows 的 git
  • 在 android studio 中启用版本控制 -> 选择 git -> 将其指向 git.exe
  • 点击测试",一切正常

这是我感到困惑的时候.我现在必须通过 git bash 手动添加遥控器,所以我打开了一个 bash 提示,但我不确定在那里输入什么.我试过这样的事情:

This is when I get confused. I now have to add the remote manually through git bash, so I open up a bash prompt and I'm not sure what to type there. I've tried things like:

git remote add origin https://github.com/[username]/[projectname].gitgit remote add origin git@github.com:[用户名]/[项目名].git对于这两种情况,我都收到错误消息致命:远程源已经存在"

git remote add origin https://github.com/[username]/[projectname].git git remote add origin git@github.com:[username]/[projectname].git for both of these I get the error message "fatal: remote origin already exists"

如果这些已经存在,为什么我在我的 github 帐户中看不到列出的项目?我试图通过 android studio 进行初步推送,但我仍然没有看到任何东西.此外,当我通过 android studio 推送时,好像一切都很好,我没有收到任何错误消息.

If these already exist then why do I not see the project listed on my github account? I've tried to do an initial push through android studio but I still don't see anything. Also, when I push through android studio it is as if everything is fine, I get no error messages.

推荐答案

您已经创建了作为远程的 origin,只需使用 git add 将您的东西添加到暂存区. 然后使用 git commit -m 'your commit message' 提交您的更改,然后是最重要的部分,PUSH 使用 git 将您的主分支发送到远程推源主.

You have origin as a remote created already, just add your stuff to the staging area using git add . then use git commit -m 'your commit message' to commit your changes, then the most important part, PUSH your master branch to your remote using git push origin master.

您应该在此处阅读有关 git 工作流程的信息:http://git-scm.com/book/en/Getting-Started-Git-Basics, http://marklodato.github.io/visual-git-guide/index-en.html.

You should read about the git workflow, here: http://git-scm.com/book/en/Getting-Started-Git-Basics, http://marklodato.github.io/visual-git-guide/index-en.html.

这篇关于如何将我的项目从 Android Studio 添加到我的 GitHub 页面?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆