First, create a warehouse on GitHub: Select repositories, click "New" on the right, enter the warehouse name, and click "Create Repositories".
The Git configuration of studio;
After installing Git, start Androidstudio, and open the following path File->settings->version Control (expand)->git
Enter the GIT path you installed in the input box after path to Git executable, as shown in:
Click the Test button if the GIT executed successfully dialog box indicates that the configuration was successful, and the dialog box displays the GIT version number you installed, as shown in
2 Configuring GitHub login information;
Open the following path File->settings->version Control (expand)->github, as shown in
Fill in the following information:
Host:github.com
Login: Your GitHub account name
Password: Your GitHub account password
Click the test button after filling out the following dialog box to indicate the success of the configuration
3 Uploading works to GitHub
Open the project you want to upload, select Vcs->import into Version control->share project on GitHub as shown in the top menu:
If you are submitting the project for the first time, the following dialog box will appear, prompting you that this is a new repository (repo), you can customize the name of the repo, and add a description.
Fill out click the Share button if you have no problem with the project will appear the following interface
Here is a list of the classes to be submitted, as well as various resource profiles and so on, click the OK button
Enter your master password Click OK, if submitted successfully the upper right corner of studio will prompt relevant information
At this point, open your GitHub website address in your repositories will see the project name you just submitted, click to see the complete submission project, to the end of this submission
Project updates
When a project has added a module or a module that modifies how to update a project on GitHub, it's also simple.
1 If you add a new class to your project, you will be prompted to add git when you create the class, as shown in
Select yes the class will be added to Git, and the class itself will have a change in color (the Darcula theme is changed from normal white to green)
This class right-click->git->commit File ... The following dialog box appears
When you click the Commit button after filling in a commit message, a warning may appear, ignoring it click Commit
Right-click->git->repository->push again, as shown in
Click on push to see the following dialog box, click the Pust button
At this point open the project source on your GitHub, you will find that the new class has already appeared
2 If a class in your project has been modified and needs to be resubmitted;
Right-click the class->git-add
If a push faild appears, you can upload it using another method:
Find the local path to the project;
Select the project right click and choose "Git";
Select push (push);
Select "Other" to tell the repository HTTPS replication that GitHub created: https://github.com/*****/***.git;
Click OK;
Enter GitHub's account number and password;
Complete.
Android Studio project uploads to GitHub