简体   繁体   English

将Android Studio项目导入GitHub

[英]Importing Android Studio Project into GitHub

I have a project made in Android Studio that I wish to put into a GitHub repository. 我有一个要在Android Studio中创建的项目,希望将其放入GitHub存储库中。 I used "Import into version control" -> "Share project on GitHub". 我使用了“导入版本控制”->“在GitHub上共享项目”。 Android Studio then made an empty repository on my GitHub account with the name that I specified. 然后,Android Studio使用我指定的名称在GitHub帐户上建立了一个空的存储库。 I simply cannot make an initial commit now that the repository is there. 现在,我已经无法在存储库中进行初始提交了。 When I use VCS -> Git -> Commit file, it simply pops up a window that says "Nothing to commit.". 当我使用VCS-> Git->提交文件时,它只是弹出一个窗口,上面写着“什么都没提交”。 I've tried making a new dummy file, and yet it still thinks there have been no changes. 我尝试制作一个新的虚拟文件,但它仍然认为没有任何更改。 I've also tried selecting all of the files and using the "add" button, but this appears to do nothing whatsoever. 我也尝试选择所有文件并使用“添加”按钮,但这似乎无济于事。 How can I get this project on GitHub? 如何在GitHub上获得该项目? My desire, specifically, is literally just to somehow commit my project in Android Studio into this GitHub repository it has created for me so that I can collaborate on this project with some friends. 具体来说,我的愿望只是想以某种方式将我在Android Studio中的项目提交到它为我创建的这个GitHub存储库中,以便我可以与一些朋友合作进行此项目。 Thanks in advance. 提前致谢。

If there is nothing to commit, Android Studio has already commited all your files locally . 如果没有要提交的内容,则表明Android Studio已在本地提交了所有文件。 Now you need to VCS > Git > Push to upload your commits to your GitHub repository. 现在,您需要VCS > Git > Push将您的提交上传到GitHub存储库。

What ended up happening is I just created a new project, copied and pasted all of my code in, and then used the "Share Project on GitHub" button again. 最终发生的事情是,我刚刚创建了一个新项目,将所有代码复制并粘贴到其中,然后再次使用“在GitHub上共享项目”按钮。 This time, for whatever reason, it worked seamlessly. 这次,无论出于何种原因,它都能无缝运行。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM