如何使用 Android Studio 的 git hub 功能
2016-03-21 10:47
561 查看
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:
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 如何监听返回键,弹出一个退出对话框
- [Android Studio 权威教程]AS添加第三方库的6种方式(Jar,module,so等)
- Android屏幕适配经验谈
- Android Touch事件分发和传递机制
- Android 进程常驻、进程守护、进程保活技术的总结
- Android中TextView在xml中设置onClick没用的解决办法
- Android Design Support Library 兼容库使用详解
- android AMS中主要的四个函数的作用
- Android FragmentManage FragmentTransaction介绍
- 解决viewpager在刷新调用notifyDataSetChanged不起作用
- 二维码识别IOS或Android客户端
- Android_自定义View
- android环境那此事--genymotion, virtualbox
- Android Studio快捷键
- Android定位
- android坐标系详解
- android之ScrollView里嵌套ListView(转)
- 数据转换的总结
- android列表视图切换:GridView和ListView两种方式来显示一个列表
- android开发-Listview中显示不同的视图布局