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

问题描述

我正在尝试将我在 Android Studio 文件夹中的项目同步到 GitHub,但我不完全确定除了在选项菜单中添加我的凭据之外还能做什么.有人可以给我一个快速指南吗?

I am trying to synchronise a project that I have on in my Android Studio folder to GitHub, but I am not fully sure what to do other than adding my credentials in the options menu. Could someone give me a quick guide, please?

推荐答案

在 Android Studio 中打开要推送的项目.

Open the project you want to push in Android Studio.

点击VCS ->启用版本控制集成 ->Git

似乎没有办法通过 GUI 添加遥控器.于是在项目根目录打开Git Bash,做git remote add ;

There doesn't seem to be a way to add a remote through the GUI. So open Git Bash in the root of the project and do git remote add <remote_name> <remote_url>

现在当你做 VCS ->提交更改 ->提交 &推你应该看到你的遥控器,一切都应该通过 GUI 工作.

Now when you do VCS -> Commit changes -> Commit & Push you should see your remote and everything should work through the GUI.

如果您收到错误:fatal: remote 已经存在 这意味着你已经添加了它.要查看您的遥控器,请执行 git remote -vgit remote rm 以删除.

If you are getting the error: fatal: remote <remote_name> already exists that means you already added it. To see your remotes do git remote -v and git remote rm <remote_name> to remove.

有关详细信息,请参阅这些页面:

See these pages for details:

http://www.jetbrains.com/idea/webhelp/使用-git-integration.html

http://gitref.org/remotes/

这篇关于如何使用 Android Studio 将项目同步到 GitHub?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

10-16 21:43