Information is based on this post:
I added more steps based on my experience.
Assuming you already have a Git account and have downloaded basic Git tools such as Git Bash.
For New Projects
Go to your account on github.com. Create a new repository. Let’s call it NewProj. DO NOT initialize the repository with a readme file.
Install Git for Windows.
Go to Android Studio. Open the project. Go to File > Settings > Version Control > Git. Test login. It must be successful.
Enable version control in your project.
VCS > Enable Version Control Integration > select “Git”
Add git remote locally.
Start Git Bash. Go to your project directory. Issue the following command:
git remote add origin https://github.com/(your user name)/NewProj
Go back to Android Studio. Select <project/file> > VCS > Git > Add to VCS. This does a Git Add
Commit chagnes: VCS > Commit Changes
Write down commit message, then choose commit. Push repository to github by selecting VCS>Git>Push
Possible error messages:
Push failed: fatal: Authentication failed for ‘https://github.com/(user name)/NewProj/’ – your password for Github is incorrect. Go back to Step 3 to test your connection
Push failed: fatal: repository ‘https://github.com/(user name)/NewProj/’ not found – you didn’t create a new repository on Github. Go back to Step 1.