如何在Android Studio中更改git分支 [英] How to change git branch in Android Studio

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

问题描述

我的gitlab项目中有2个分支.现在我在master(默认)分支上.我想将其更改为另一个基准,这是我尝试过的:

I have 2 branches in my gitlab project. Now I'm on the master (default) branch. I want to change it to another base, this is what I tried:

当我转到VCS -> Git -> Branches并单击Checkout tag or revision时,我总是收到错误消息:

When I go to VCS -> Git -> Branches, and click Checkout tag or revision I always get an error :

pathspec我的分支"与git已知的任何文件都不匹配

pathspec 'my branch' did not match any files known to git

我该怎么办?我要做的就是更改branch并执行pull请求.

What should I do? All I want to do is to change the branch and do a pull request.

推荐答案

要从Android Studio中签出其他分支:

To checkout a different branch from within Android Studio:

VCS-> Git->分支下,您将看到此屏幕

本地分支机构下,您会看到可以检出的本地分支机构.在最底部,您可以看到当前已签出的分支(在我的情况下为master).要签出其他分支,请选择它,然后单击签出.

under Local branches you will see the local branches you can checkout. At the very bottom you see the currently checked out branch (in my case master). To checkout a different branch, select it and click Checkout.

在我的示例中,我只有一个本地分支,名为test.这就是为什么它只显示一个.

In my example I only have one other local branch, named test. That is why it only shows that one.

签出其他分支后,该窗口将在屏幕底部弹出

After checking out a different branch, this window will pop up in the bottom of the screen

为了使您的远程分支能够显示在Android Studio中,您首先需要获取它们:

In order to get your remote branches to show up in Android Studio, you first need to fetch them:

VCS-> Git->获取.之后,它将显示

这篇关于如何在Android Studio中更改git分支的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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