How to use the Git hub feature of Android Studio

Source: Internet
Author: User

How to use GitHub with Android Studio

This article would 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 a 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 would open in Android Studio. On the top menu, select VCS > Import into Version Control >create Git Repository.

On the next screens, 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 don't 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 is added to your Git repository.

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

It would seem like nothing had happened, but trust me, the project files is added.

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

In the next screen, type a commits 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'll see the this message.

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

Hope that was helpful.

Top

How to use the Git hub feature of Android Studio

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.