We initialized our code repository. It is time to create a project. Start Android Studio and choose the following:
Start a new Android Studio Project or File | New | New Project.
Create New Projectand a window appears.
Fill the application information:
Then, click on Next.
Check the Phone and Tablet option, and then choose Android 5.0 as the minimum Android version as follows:
Click on Next again.
Choose Add No Activity and click on Finish, as follows:
Wait until your project is created.
You will notice a message about Unregistered VCS root detected. Click on add root or go to Preferences | Version Control | , and then select our Git repository from the list and the click on then + icon, as shown in the following screenshot:
To confirm everything, click on Apply and OK.
Before committing and pushing, update your .gitignore files. The purpose of the .gitignore file is to allow you to ignore files, such as editor backup files, build products, or local configuration overrides that you never want to commit into a repository. Without matching the .gitignore rules, these files will appear in the untracked files section of the Git status output.
Open .gitignore located in your project root directory and edit it. To access it, expand Project by clicking on Project on the left side of Android Studio, and then, from the drop-down menu, choose Project, as shown in the following screenshot:
You can use this .gitignore configuration from the preceding. Now we can commit and pushcmd + 9 on macOS or ctrl + 9 on Windows/Linux (shortcut for View | Tool Windows | Version Control). Expand unversioned files, select them, and right-click on Add to VCS.
Press Cmd + K (or Ctrl + K on Windows/Linux), check all files, enter commit message, and, from the Commit drop-down menu, choose Commit and Push. If you get Line Separators Warning, choose Fix and Commit. The Push Commits window will appear. Check Push Tags and choose Current Branch, and then Push.