我试图同步一个项目,我在我的Android工作室文件夹到GitHub,但我不完全确定要做什么,除了在选项菜单中添加我的凭据。有人能给我简单介绍一下吗?
当前回答
下面的方法是将一个Android Studio项目仅仅使用GUI推到一个基于GIT的存储库的通用方法。这已经在Visual Studio Online托管的GIT存储库中进行了测试,并且应该与GitHub或任何其他基于GIT的版本控制提供商一起工作。
注意:如果您正在使用GitHub,“在GitHub上共享”是其他答案中所述的最简单的选项。
启用GIT集成插件 文件(主菜单)>>设置>>搜索GitHub集成
为项目启用版本控制集成 VCS(主菜单)>>启用版本控制集成>>选中“GIT”
将项目文件添加到本地存储库 右键单击项目>> GIT >> Add
提交已添加的文件 打开版本控制窗口(终端窗口旁边)>>单击“提交” 按钮 在提示窗口中选择“commit and push”
定义远程 在分析代码后,android studio将提示审查或提交代码 提交时将提示定义远程存储库。你可以 将url添加到GIT存储库。 然后输入存储库的凭据并单击“Ok”。(Visual Studio 在线用户需要启用“备用身份验证凭据”作为 此处提到登录到存储库)
其他回答
这并不局限于Android Studio,而是Intellij的IDEA的普遍行为。
转到:首选项>版本控制> GitHub
另外请注意,你不需要github集成:标准的git函数应该足够了(VCS > git, Tool Windows > Changes)
我第一次添加视频链接来解决你的问题,但我知道这是一个坏主意。这次我简单解释一下。
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
在Android Studio 0.8.2中,你有相同的选项(即在GitHub上共享)。如果你想找到它,你可以使用ctrl+shift+a并在输入文本中输入github。
下面的方法是将一个Android Studio项目仅仅使用GUI推到一个基于GIT的存储库的通用方法。这已经在Visual Studio Online托管的GIT存储库中进行了测试,并且应该与GitHub或任何其他基于GIT的版本控制提供商一起工作。
注意:如果您正在使用GitHub,“在GitHub上共享”是其他答案中所述的最简单的选项。
启用GIT集成插件 文件(主菜单)>>设置>>搜索GitHub集成
为项目启用版本控制集成 VCS(主菜单)>>启用版本控制集成>>选中“GIT”
将项目文件添加到本地存储库 右键单击项目>> GIT >> Add
提交已添加的文件 打开版本控制窗口(终端窗口旁边)>>单击“提交” 按钮 在提示窗口中选择“commit and push”
定义远程 在分析代码后,android studio将提示审查或提交代码 提交时将提示定义远程存储库。你可以 将url添加到GIT存储库。 然后输入存储库的凭据并单击“Ok”。(Visual Studio 在线用户需要启用“备用身份验证凭据”作为 此处提到登录到存储库)
对于现有的项目结束现有的存储库文件:
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中的。iml文件是什么?
- 如何在新的材质主题中改变背面箭头的颜色?
- androidviewpager与底部点
- 相同的导航抽屉在不同的活动
- 如何从视图中获得托管活动?
- 单一的TextView与多种颜色的文本
- 如何在非活动类(LocationManager)中使用getSystemService ?
- 在清单中注册应用程序类?
- Android:从数组中编程创建旋转器
- Android命令行工具sdkmanager总是显示:警告:无法创建设置
- 在另一个目录中运行操作
- GitHub克隆与OAuth访问令牌
- 如何设置RecyclerView应用程序:layoutManager=""从XML?
- 在没有开发服务器的情况下在设备上构建和安装unsigned apk ?
- 操作栏和新引入的工具栏有什么不同?