Step 1 - Sign Up GitHub and Install Git
Step 2 - Enable Version Control Integration
In your Android Studio, After creating Project, Go to menu "VCS→Enable Version Control Integration..."
Select "Git" and click "OK"
Step 3 - Share Project on GitHub
Go to menu "Git→GitHub→Share Project on GitHub"
Login GitHub account either via GitHub website or with token. GitHub website login didn't work for me. So I ended up use token instead.
Click "Generate..." and follow the instructions to get the generated token
Copy and paste the token, click "Add Account"
Name your repository name, check "Private" if you want to create a private repository. Then, click "Share". A new repository is created.
Click "Add" to commit your files
That is it. Your project now has been uploaded to your GitHub repository. After you make some local changes to your file, you need to commit and push those changes into a GitHub repository.
The following steps show you how to do that.
Make Changes to Your Files
Step 1 - Commit your files
Click "commit" in the top right corner. You can also go to menu "Git→Commit"
Enter your commit description and click "Commit and Push..."
There are code analysis warnings, you can either review them or just go ahead to push your files
Click "Push". Your files have been updated in the repository
You can also click "Commit" and push your files later on. To push your files, click "push" in the top right corner. You can also go to menu "Git→Push". The rest of the steps are very similar to "Commit and Push" above.
Another common thing I do before I commit the files is review my changes. The following steps show you how you can review and make any changes to your files in the committing screen.
Select a file, right click and click "Show Diff"
Step 2 - Select "step-by-step viewer"
By default, it is "Unified viewer" which I don't like.
Step 3 - Review and Make Changes
Now you can review your change. You can also make changes to your file from this window.