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.

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

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

Leave the next page as default and click Next.

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

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

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

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

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

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.

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.

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

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

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

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

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

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

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

Hope that was helpful.

 

如何使用 Android Studio 的 git hub 功能的更多相关文章

  1. Android Studio配置Git及Git文件状态说明

    Android Studio配置Git还是比较简单的,麻烦的是可能中间出现各种问题.如果你想了解或感兴趣,请往下看. 首先你得下载Git客户端,网址:http://git-scm.com/downlo ...

  2. 或许是介绍Android Studio使用Git最详细的文章

    欢迎访问我的个人博客转发请注明出处:http://www.wensibo.top/2017/03/12/GitOnAS/ 前言 本文较长,图片很多很多,流量党慎入 使用Git已经有一段时间了,但是之前 ...

  3. Android Studio中Git和GitHub使用详解

    一.Git和GitHub简述 1.Git 分布式版本控制系统,最先使用于Linux社区,是一个开源免费的版本控制系统,功能类似于SVN和CVS.Git与其他版本管理工具最大的区别点和优点就是分布式: ...

  4. Android studio使用git教程

    ①下载Git工具,配置到Android studio中 http://git-scm.com/downloads ------------------------------------------- ...

  5. Android studio配置Git

    Android studio配置Git 1.下载window 版git并安装:下载地址 2.Android Studio设置git插件:File->Setting->Version Con ...

  6. Android Studio 通过 git update 或者 pull 的时候出错及解决办法

    Android Studio 通过 git update 或者 pull 的时候出错,log 如下: Couldn't save uncommitted changes. Tried to save ...

  7. Win环境 Android Studio使用Git 教程 ( 一 )

    一. 安装 下载安装完成Git后 进入命令行 输入命令git --version,如果能显示版本则说明安装成功,如果没有显示版本,需要配置环境变量: 在path中添加git的安装位置 二 . 配置信息 ...

  8. Android Studio的git功能的使用介绍

    本文介绍Android Studio(下面简称AS)中git工具的一些简单使用.因为AS为git的使用提供了很多人性化的图形界面操作,在很大程度上可以增加开发效率.本文面向新手,题主自己也是新手一枚, ...

  9. Android Studio 2.2新功能预览

    升级SDK可用Background 多加了个按钮,可用一边写代码一边下载SDK Instant Run 修改代码一秒启动 APK analyzer 分析任何的APK 查看APK下载包的大小,解压后的实 ...

随机推荐

  1. Lazarus解决含中文文件名或路径的使用问题

      其实用lazarus很久(也不算久啦..),目前打算做完手头的最后一个小程序然后就转向c#窗体程序..之前用lazarus的时候出了很多问题,资料也不是很好找,所以这回把比较容易说的记下来省得忘掉 ...

  2. shell基础认识

    Shell 我们在终端下写命令Linux内核是看不懂的必须通过shell解释成内核可执行的代码 这就是shell(其实解释命令这只是它的一个功能模块,shell还可以用来进行程序设计) 有点类似win ...

  3. js 获取月份 格式yy-mm-dd

    /** * 获取上一个月 * * @date 格式为yyyy-mm-dd的日期,如:2014-01-25 */ function getPreMonth(date) { var arr = date. ...

  4. OpenCV学习 2:播放AVI视频

    原创文章,欢迎转载,转载请注明出处 第二个程序,播放视频.用opencv做起来是如此的简单..哈哈.           学Opencv,只是为了在它的基础上实现工程应用,而它里面高深的理论我等屌丝只 ...

  5. Orchard 源码探索(Application_Start)之异步委托调用

    2014年5月26日 10:26:31 晴 ASP.NET 接收到对应用程序中任何资源的第一个请求时,名为ApplicationManager 的类会创建一个应用程序域.应用程序域为全局变量提供应用程 ...

  6. [问题解决] "Nautilus could not create the required folder "/home/kenneth/.config/nautilus"

    错误: "Nautilus could not create the required folder "/home/kenneth/.config/nautilus" 发 ...

  7. 解决:未能加载文件或程序集“Newtonsoft.Json, Version=4.5.0.0

    开发环境:Microsoft Visual Studio 2013 MVC4.0 使用SignalR的过程中随着版本的升级,其它程序集也跟着升级,如Newtonsoft.Json,一般编译的时候,如果 ...

  8. Silverlight Socket 实现收发信息

    原文 http://www.cnblogs.com/ZetaChow/archive/2009/05/16/2237347.html 刚接触Silverlight的时候,除了其异步应用WCF.流媒体. ...

  9. 04737_C++程序设计_第5章_特殊函数和成员

    例5.1 分析下面程序中析构函数与构造函数的调用顺序. #include<iostream> using namespace std; class object { private: in ...

  10. 达内TTS6.0课件oop_day04