How to use Github on Android Studio

Source: Internet
Author: User

How to use Github on Android Studio

First, log on to Github and create a new repository. In the upper-right corner of the screen, click "+" and select "New repository ".

 

Now, this table is complete to create a new repository named testproject, so that this repository is automatically initialized and the REDEME file is included.

Next, open Android Studio and create a new project named TestProject. Click "Next" to proceed.

The Next page is set to default and click "Next ".

.

Your project has already appeared on Android Studio. In the top title bar, choose VCS> Import into Version Control> Create Git Repository.

 

On the next page, keep the default value and click "OK ".

Android Studio "Select

Use Windows Resource Manager to navigate to the root directory of the project. Right-click and select Git Bash (if you do not have this option, install Git for Windows first ).

When the Git bash interface is displayed, enter:

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

For example, here Git repository URL is: https://github.com/markwint/testproject.git

Then press Enter. Github will be remotely added to your Git repository.

Return to Android Studio, click the root directory of your project, and select Git> Add. It will add all your project files to your Git repository.

Add option width = 538 height = 518 scale = 1.5/> Android Studio "Git> Add" option

It seems that nothing has happened (the translator did not see the exception), but believe me, the project file has been added.

Right-click the project name again, and select Git> Commit Directory this time.

On the next page, enter the Commit Message and select "Commit ".

If the code analysis warning appears, click "Commit ". (Unless this is an actual project, in this case it should be reviewed and resolved before submission !)

Right-click the project name and choose Git> Repository> Push.

Check the current branch in the box, leave the main branch name, and then select push.

Enter your Github Login (Email address) and Password, and then click "OK ".

If there is no problem, you will see this message.

 

Now your code has been pushed to your Github repository. Don't believe me? Log in and check it. (When a foreigner writes Login as a Logon, it seems that we didn't write the error .)

Hope this is useful.

 

 

 

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.