android studio check out,Android Studio - checkout a *branch* from GitHub

问题

We have a repo in GitHub which has 3 branches. For example, say master, developer and preview.

When I checkout this repo in Android Studio, it seems to checkout the master branch only, ignoring all other branches. (Eclipse used to ask us which branch to checkout/import when we are cloning a repo from GitHub)

The question is : How can we select a branch at the time of checking out a repo into Android Studio?

Image 1- Checking out from GitHub

8dcd28f4c19b2f45ad786c0fd663e7be.png

Image 2- It just asks for the repo URL, but NOT a branch.

3a84ffac1150782858099187815d4056.png

回答1:

In VCS menu, you choose git and click branch to choose which branch you want to use.

e26e3ff0eb4c418fd93b4dcaf41578d6.png

Or click right bottom corner git menu.

8518e64d128665cc4b9ad9d7875a1d01.png

回答2:

In AndroidStudio you have also the terminal (Tools --> Open Terminal, or View --> Tool Windows --> Terminal), open it, the current directory will be directly your project's, then just execute

git checkout the_name_of_the_branch

and that's all.

I would recommend you then to use this: http://martinfitzpatrick.name/article/add-git-branch-name-to-terminal-prompt-mac/ it will be much easier to see on which branch you are, directly in the terminal.

回答3:

The branch selection is done by two steps:

VCS-GIT-FETCH (unfetched externally created branch is invisible for you)

VCS-GIT-Branches-(Remote branches - branch name)-Checkout

The VCS-GIT-Branches can be reached by one click - in the right lower corner on GIT:[current branch name]

来源:https://stackoverflow.com/questions/17589828/android-studio-checkout-a-branch-from-github

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值