zoukankan      html  css  js  c++  java
  • Android Studio 使用github

    转:

      

    How to use GitHub with Android Studio

    This article will explain how to use GitHub with Android Studio.

    Firstly, let’s login to github.com and create a new repository. From the top right corner of the screen, click the +sign and select New repository.

    GitHub "New repository" option

    Now complete the form to create a new repository called testproject. Leave the Initialize this repository with a README unticked.

    GitHub create new repository form

    Next, open Android Studio and create a new project. Call your new application TestProject. Click Next to continue.

    Android Studio new project window

    Leave the next page as default and click Next.

    Android Studio "Select the form factors your app will run on" screen

    On the Add an activity to Mobile screen select Blank Activity and click Next.

    Android Studio "Add an activity to Mobile" screen

    In the next screen, leave the default activity name of MyActivity and click Finish.

    Android Studio "New file options" screen

    Your new project will open in Android Studio. On the top menu, select VCS > Import into Version Control >Create Git Repository.

    Android Studio "Create Git Repository" option.

    On the next screen, leave it all as default and click OK.

    Android Studio "Select directory for git init" screen

    Now use Internet Explorer and navigate to the root of your projects folder. Right click and select Git Bash (If you do not see this option, then first install Git for Windows).

    When the Git bash screen appears, type:

    1
    git remote add origin https://github.com/[username]/[project_name].git

    An example of a Git repository URL is: https://github.com/markwint/testproject.git

    Entering command into Git Bash

    Then press enter. The GitHub remote will be added to your Git repository.

    Next, jump back into Android Studio, right click your projects root directory and select Git > Add. This will add all your project files to your Git repository.

    Android Studio "Git > Add" option

    It will seem like nothing has happened, but trust me, the project files are added.

    Now right click the project name again and this time select Git > Commit Directory.

    Android Studio "Commit Directory" option

    In the next screen, type a Commit Message and select Commit.

    Android Studio "Commit Changes" option

    If a Code Analysis warning appears, click Commit. (Unless it’s a real project, in which case review and fix the issue before committing!)

    Android Studio "Code Analysis" warning

    Now, right click the project name, select Git > Repository > Push.

    Android Studio "Git Push" option

    Check the box Push current branch to alternative branch and leave the branch name as master. Then select push.

    Android Studio "Git Push" prompt

    Now enter your GitHub Login (email address) and Password. Then click OK.

    Android Studio GitHub Remote Login

    If it’s all good, you will see this message.

    Android Studio Successful Git Push

    Now your code is pushed to your GitHub repository. Don’t believe me? Logon and check for yourself.

    GitHub repository pushed from Android Studio

    Hope that was helpful.

  • 相关阅读:
    qemu-kvm 基础
    QEMU、KVM、libvirt三者间的关系
    QEMU和KVM的关系
    生死乃世间常事,若真爱,请许我出家
    净土大经科注(第四回)第28集文字稿
    净土大经科注 第18集(部分,文字不全)
    二零一四净土大经科注  (第十二集文字稿)
    净土大经科注(第四回)第14集文字稿
    陈静瑜老师系列讲座汇编
    陈静瑜老师:人这个烦恼习气真的是很难改,如果没有坚定的决心,像《了凡四训》上说的那种勇猛心,那种畏惧心、羞耻心,很难回头改过。
  • 原文地址:https://www.cnblogs.com/spring87/p/4318132.html
Copyright © 2011-2022 走看看