First, log on to GitHub and create a new repository. In the upper-right corner of the screen, click the "+" flag and select "New repository".
Now complete this form to create a new repository called TestProject, and let the repository automatically initialize and bring the Redeme file.
Next, open Android Studio and create a new project called TestProject, and click "Next" to proceed to the next step.
The next page is set to default, and continue clicking "Next".
.
Your project already appears on Android studio, in the top title bar, selectVCS>Import into Version Control>Create Git Repository.
On the next page, leave the default and click "OK".
Android Studio "Select
Now use Windows Explorer to navigate to the project's root directory. Right-click and choose Git Bash (if you don't have this option, you'll need to install git for Windows first).
When the Git bash interface comes out, enter:
1 |
git remote Add Origin https:
//github
.com/[username]/[project_name].git
|
As an example, the URL for git repository here is: https://github.com/markwint/testproject.git
Then press Enter,github will be added remotely to your git repository.
Back to Android Studio, mail click on your project root and choose Git > Add. It will add all your project files to your git repository.
Add "option" width= "538" height= "518" scale= "1.5" style= "Box-sizing:border-box; BORDER:1PX Solid RGB (248, 248, 248); Vertical-align:middle; Height:auto; max-width:100%; "/> Android Studio" Git > Add "option
It doesn't seem to happen (the translator doesn't see the difference), but trust me, the project file has been added.
Now right-click the project name again, and this time choose Git > Commit Directory.
On the next page, enter a commit message and select Commit.
If the Code Analysis warning appears, click "Commit". (Unless this is an actual project, in this case it has to be reviewed and resolved before submission!) )
Now, right-click the project name and choose Git > Repository > Push.
Check the current branch in the box, leave the main branch name, and select Push.
Now enter your GitHub Login (email address) and password, then click "OK".
If that's all fine, then you'll see the message.
Now your code has been pushed to your GitHub repository. Don't believe me? Log in and check it out. (Foreigners here to write login Logon, it does not seem that we will be writing a typo.) )
Let's hope this works.
For the bloggers ... That means you can use it, ^_^.
How to use GitHub on Android studio