我试图同步一个项目,我在我的Android工作室文件夹到GitHub,但我不完全确定要做什么,除了在选项菜单中添加我的凭据。有人能给我简单介绍一下吗?


当前回答

对于现有的项目结束现有的存储库文件:

git init
git remote add origin <.git>
git checkout -b master
git branch --set-upstream-to=origin/master master
git pull --allow-unrelated-histories

其他回答

Android Studio 3.0

我喜欢在Android Studio中这么简单。

1. 输入你的GitHub登录信息

在Android Studio去文件>设置>版本控制> GitHub。然后输入您的GitHub用户名和密码。(您只需执行此步骤一次。对于以后的项目,你可以跳过它。)

2. 分享你的项目

当你的Android Studio项目打开时,进入VCS >导入到GitHub上的版本控制>共享项目。

然后单击“共享”,单击“确定”。

这是所有!

在Android Studio 0.8.2中,你有相同的选项(即在GitHub上共享)。如果你想找到它,你可以使用ctrl+shift+a并在输入文本中输入github。

在Android Studio 1.0.2上,你只需要去 VCS->导入到版本控制->共享项目在GitHub。

弹出窗口将出现,要求回购名称。

对于现有的项目结束现有的存储库文件:

git init
git remote add origin <.git>
git checkout -b master
git branch --set-upstream-to=origin/master master
git pull --allow-unrelated-histories

我第一次添加视频链接来解决你的问题,但我知道这是一个坏主意。这次我简单解释一下。

Android studio与github兼容,但你需要调整一些东西:

Setup Android Studio Setup the Github plugins in the Android Studio settings Android Studio settings >> Plugins page Download the git version control system from this link and setup https://git-scm.com/ After the installation, open Android Studio settings page and select the git.exe settings >> version control >> git Usually the path to git.exe is program files >> git >> bin >> git.exe Go to Settings >> Version control >> Github you will see login and password for your Github account. Apply the settings. For updating the project, go in Android Studio top line click VCS >> enable version control integration >> git One more time VCS >> import into version control >> share project on Github and enter your master password.

现在你可以使用VCS更新按钮将你的项目更新到Github