[Android] How to use github with android studio
来源:互联网 发布:js输入框输入触发事件 编辑:程序博客网 时间:2024/05/18 03:04
For this tutorial, the project will be connected to Github.
The meaning of this post is to give you a quick start to get you up and running.
Using Version Control (VCS)
Android Studio can work with the following VCS:
Git, GitHub, Mercurial, and Subversion.
To use one of the systems, you must have the appropriate program that is used by the VCS installed on the computer. For Git, GitHub and Bitbucket this would be the “git”, for Mercurial “hg” and subversion “svn”.
If you’re not familiar with Github, please visit Github’s Guide.
For the following steps, I will use the “Hello World” Project from the tutorial:
Setting up VCS for the current project
Step 1: Configuring the VCS
From the Welcome screen-> Configure -> Project Defaults-> Settings -> Version ControlIn the Version Control Menu select Github
Setting up GitHub
To connect the project with GitHub, you have to use a previously opened GitHub account otherwise click on the GitHub “Sign up” button.
To make sure that the connection is working, press the Test button and wait for the success message.
Close the Window to get back to the Welcome Screen and open the project you want to connect or start a new project.
I open the Hello World project from earlier which was automatically named “My Application”.
Step 2: Enable VCS in the current project
To activate the current Project for cooperation with a VCS, you choose from the menu bar “VCS” and then “Enable Project for Version Control Integration”.
Only now, the menu offers all VCS related resources such as, “share project on GitHub”.
Go ahead and choose from the VCS menu-> Import into Version control-> Share Project on Github
The repository name had to be changed from “My Application” into “MyApplication”.
All the current files from this project are going to be uploaded to Github.
If you go to the bottom of your screen, you can now choose from the toolbar “Version Control” and control/ manage your project with Github.
So far, we did all the work from our Android Studio IDE. Let’s go to GitHub and take a look at the repository:
https://github.com/greendogs/MyApplication
When I was on the GitHub repository, I added a README file to the project.
How to synchronize changes from the GitHub repository to the local
repository (Android Studio Project)?
Go to the VCS menu and choose “Update Project ..”Confirm the pop-up menu
Depending on your Internet connection and the size of the file you wish to synchronize, it takes some seconds to some minutes.
After the synchronization has finished, you can see it in the VCS notification window.
Now, I’m going to make a change on my project in Android Studio. To keep it simple, I only changed the background color from the activity_main.xml.
The changes have been recognized by the VCS and been documented. You can see the documentation of any change in the notification window on the bottom, under “Changes”:
To synchronize the local changes with the online GitHub repository, go
to VCS and choose:
commit changes
write your Commit MessageCommit (commit and push)
The changes can be seen on the GitHub repository right away.
This is the End of the Quick Start Tutorial. Now, it’s your turn to explore all the VCS related features that are available in Android Studio.
PS:
You don’t have to setup a special local repository for this project. The local repository is your project location.
- How to use GitHub with Android Studio
- How to use GitHub with Android Studio
- [Android] How to use github with android studio
- How to Use OpenCV in Android Studio
- how to use BaiduMap in android studio under ubuntu
- Github how to use
- How to use github
- (转)How to use MySQL with 3D Studio Max
- Using Github with Android Studio
- Android JNI ArrayList how to use
- how to use linux nfs in android
- How to use Android HW Video Codec
- How to use addr2line in Android
- How to use Fragment in Android
- How to Use Loaders in Android
- How to use tcpdump on Android
- How to use Android HW Video Codec
- How To Use Proguard in Android APP
- HDU 4604 Deque
- Android中添加水平线和垂直线
- JavaScript 文件拖拽上传插件 dropzone.js 学习总结。
- NUPT- DFS 算法题1047
- const, static, define 以及inline的区别
- [Android] How to use github with android studio
- Linux kernel 分析之八:系统调用参数
- zoj 3741 Eternal Reality DP
- 如何根据标签文字获取标签Size
- !HDU 4135 Co-prime-容斥原理-(位运算技巧)
- 使用httpFS访问hdfs
- Selenium学习笔记之005:第一个selenium+python+webdriver脚本
- Qt MVC学习 模型子类化参考(三)
- 几种排序的源代码