How to use Github and androidgithub 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.
For bloggers ...... It indicates it can be used. ^_^