如何使用git分支与Android工作室 [英] How to use git branch with Android Studio

查看:109
本文介绍了如何使用git分支与Android工作室的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是新来的git。我有一个非常简单的场景使用Git。我有我写了Android Studio的第一个版本。现在我想用一些新功能的工作。我所做的,到目前为止:

I am new to git. I have a very simple scenario for using git. I had my first release written with Android Studio. Now I want to work with some new features. What I did so far:

  1. 启用VCS在我的Andr​​oid工作室
  2. 创建一个本地存储库从Android的工作室
  3. 我的项目
  4. 在推我的本地库到我的远程到位桶储存库( $混帐推-u产地主
  1. enabled the VCS in my Android Studio
  2. created a local repository for my project from Android Studio
  3. pushed my local repository to my Bitbucket remote repository ($git push -u origin master)

现在我感到困惑的下一步:创建一个特性分支。我应该在本地存储库中创建一个分支:

Now I am confused for the next step: create a feature branch. Should I create a branch in the local repository:

$ git branch --track feature1 origin/master 

或者我应该从创建到位桶门户网站一个新的分支,并克隆了新的分支?

or should I create a new branch from the Bitbucket web portal, and clone the new branch?

我也想知道我可以切换分支与Android工作室?例如,从特性分支切换到主分支工作的一些修补程序。我是否需要使用插件到位桶从远程仓库我每次切换分支签出的项目非常时期,我也可以热内Android的工作室?

I also want to know how I can switch branches with Android Studio? For example, switch from feature branch to master branch to work on some hotfix. Do I need to use the Bitbucket plugin to checkout the project very time from the remote repository every time I switch branches or I can hot switch it inside Android Studio?

谢谢!

推荐答案

您应该可以从这个Android的工作室。最简单的方法是将Android的工作室窗口,您应该看到文本的右下角的混帐:分支机构的名称,你的情况应该说混帐:大师。点击,它会显示一个小菜单,包括不同的分支提供本地和远程的,也应该有一个选项+新科,这会为你创建一个新的分支并切换到它。现在,你应该能够改变一些code,承诺,并将其推送到远程。合并,检查出的分支也可以从同样的菜单进行。同样的事情可以ALS可以从菜单栏中选择VCS做

You should be able to this from Android studio. The easiest way is going to the bottom right corner of the Android Studio window where you should see the text "Git: branch name", in your case it should say "Git: master". Click on and it will show a small menu consisting of the different branches available both locally and remotely, also there should be an option "+ New Branch" which will create a new branch for you and switch you to it. Now you should be able to change some code, commit it and push it to remote. Merging and checking out branches can also be done from that same menu. The same thing can als be done from the menubar option "VCS"

这篇关于如何使用git分支与Android工作室的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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