如何使用 Android Studio 提交和推送 Android 应用程序/项目到预先存在的空 Bitbucket 存储库? [英] How to Commit and Push Android App/Project to Pre-existing Empty Bitbucket Repository with Android Studio?

查看:20
本文介绍了如何使用 Android Studio 提交和推送 Android 应用程序/项目到预先存在的空 Bitbucket 存储库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

所以我正在运行最新版本的 Android Studio (0.6.1) 并想推送到 BitBucket,因为它有免费的私有存储库(让我们避免任何 Github vs BB 评论).我创建了一个简单的 repo 来测试 VCS 功能,并且正在使用一个带有默认配置的新 Android 项目,除了应用名为TestApp"并且项目文件位于我的桌面上.

So I'm running the latest version of Android Studio (0.6.1) and want to push to BitBucket because it has free private repos (let's avoid any Github vs BB comments). I've created a simple repo to test the VCS functionality and am using a new Android project with the default configs except the app is called 'TestApp' and the project file is located on my desktop.

我已执行以下步骤:

  1. VCS>导入到版本控制>创建 Git 存储库
  2. 使用默认路径:C:\Users\User\Desktop\TestApp"
  3. VCS>Git>从版本控制检出
  4. https://sanecito@bitbucket.org/sanecito/testrepo.git 作为 VCS 路径,C:\Users\User\Desktop\"作为父目录,testrepo 作为文件夹
  5. 当收到您是否希望为已检出到 C:\Users\User\Desktop\testrepo 的源创建一个 Android Studio 项目"时,点击是"
  6. 从现有源创建项目
  7. 项目名称:testrepo 项目位置:C:/Users/User/Desktop/testrepo
  8. 在新窗口中打开项目
  9. 向IDE中的testrepo添加带有文本test"的文本文件,是否要将以下文件添加到Git?[...]">是
  10. 使用菜单中的绿色箭头按钮点击 VCS(提交更改)
  11. 将鼠标悬停在提交"按钮上,点击提交并按下
  12. 在下一个窗口中点击推送"
  1. VCS>Import into Version Control>Create Git Repository
  2. Use default path: "C:\Users\User\Desktop\TestApp"
  3. VCS>Git>Checkout from Version control
  4. Give https://sanecito@bitbucket.org/sanecito/testrepo.git as VCS path and "C:\Users\User\Desktop\" as parent directory, and testrepo as folder
  5. When given "Would you like to create an Android Studio project for the sources you have checked out to C:\Users\User\Desktop\testrepo", hit "Yes"
  6. Create project from existing sources
  7. Project name: testrepo Project location: C:/Users/User/Desktop/testrepo
  8. Open project in new window
  9. Add textfile with text "test" to testrepo in IDE, "Do you want to add the following file to Git? [...]">Yes
  10. Hit VCS with green arrow button in the menu (Commit Changes)
  11. Mouse over 'Commit' button, hit commit and push
  12. Hit 'Push' in next window

推送窗口消失,底部有一个简短的弹出窗口,尽管在前一个窗口中显示项目发生了变化,但仍然显示没有什么可推送"我的过程有几个问题,首先是我想创建一个 vanilla Android 项目,然后推送到空的 repo,但在我尝试链接它时,它创建了一个新项目(在没有 vanilla 应用程序的情况下).即使在我点击提交并推送的新项目中,它实际上并没有被推送到存储库.

Push window vanishes and there's a brief pop-up window at the bottom that there's "Nothing to push" despite showing in the previous window that there were changes to the project There are several issues with my process, the first is that I would like to create a vanilla Android project and then push to the empty repo, but in my trying to link it it creates a new project (abet without the vanilla app). Even with that new project when I hit commit and push it isn't actually pushed to the repo.

我知道有这个问题:如何将项目从 Android Studio 导入 bitbucket 存储库?但是,所有答案都无法解决应该是一个简单问题的问题,因为它们没有描述性(即我什至应该如何设置插件).有人可以告诉我如何做两件事:

I'm aware that there's this question: How to import a Project into bitbucket repository from Android Studio? However, none of the of the answers are useful to solving what should be a simple issue as they aren't descriptive (i.e. how am I even supposed to setup the plug-in). Could someone tell me how to do two things:

  1. 在现有的 Android 项目和应用程序打开的情况下设置 Git,并将其推送到 BitBucket 上的存储库
  2. 使用全新的 Android Studio 安装设置 Git 配置,以便人们可以从 BitBucket 存储库中提取 Android 应用代码以进行工作

推荐答案

完整的解决方案可以在这里找到:https://www.youtube.com/watch?v=IBEbJUEDWZQ

The solution in full can be found here: https://www.youtube.com/watch?v=IBEbJUEDWZQ

我输入了如何设置插件以及如何从非空存储库中提取(随意使用您自己选择的父目录,我只是觉得这会导致一个干净的设置),视频有如何推送到一个空的仓库

I typed up how to setup the plugin and how pull from a non-empty repo (feel free to use parent directory of your own choosing, I just felt this lead to a clean setup), the video has how to push to an empty repo

  1. 设置 BitBucket 插件

  1. 下载适用于 IDEA/Android Studio 的 BitBucket 插件
  1. Download BitBucket Plugin for IDEA/Android Studio
  1. 在撰写本文时 (2014/06/25) 官方插件 不支持当前版本的 Android Studio (0.6.1) 使用的 IDEA13.但是,有一个 非官方版本 有效(获取最新版本)莉>
  1. At the time of writing (2014/06/25) the official plugin does not support IDEA13 which the current version of Android Studio (0.6.1) uses. However, there is an unofficial version that works (get the latest version)

  • 打开 Android Studio
  • 在主菜单上点击配置",然后点击插件"

  • Open Android Studio
  • On main menu click 'Configure' and then 'Plugins'

    1. 点击从磁盘安装插件",导航到插件 .zip 文件位置,选择它,然后点击确定".

  • 出现提示时重新启动 Android Studio
  • 将 BitBucket 存储库拉到本地计算机存储库

    1. 如果 Android Studio 尚未运行,请启动它
    2. 从快速开始"菜单中,选择从版本控制签出"
    3. 对于父目录",单击右侧的..."并导航到 C:\Users\ [用户名]\repos
    1. If Android Studio is not already running, start it
    2. From the 'Quick Start' menu, select 'Check out from Version Control'
    3. For 'Parent directory' click "..." on the right and navigate to C:\Users\ [username]\repos
    1. 如果repos"不存在,请单击新建文件夹"按钮(或热键 Alt+Insert)创建一个新文件夹,并将新文件夹命名为repos"

  • 在Checkout from"下拉菜单中选择BitBucket"并在出现提示时输入 BitBucket 凭据
  • 从存储库列表:"下拉列表中,您应该会看到所需的存储库.选择它,然后单击确定"
  • 这篇关于如何使用 Android Studio 提交和推送 Android 应用程序/项目到预先存在的空 Bitbucket 存储库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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