Android Studio - checkout a *branch* from GitHub

前端 未结 3 1875
终归单人心
终归单人心 2021-02-04 02:54

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

When I checkout this re

相关标签:
3条回答
  • 2021-02-04 03:30

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

    enter image description here

    Or click right bottom corner git menu.

    enter image description here

    0 讨论(0)
  • 2021-02-04 03:40

    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.

    0 讨论(0)
  • 2021-02-04 03:46

    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]

    0 讨论(0)
提交回复
热议问题