Blog #5: Android Studio & GitHub: Create, Push, and Commit

Step 1: At the top bar menu, choose File, then Settings.

Figure 5.1: Go to Settings.

Step 2: Version Control -> Git. Test path to Git, if version is shown, click OK. If I don’t have Git, I should download latest version of Git.

Figure 5.2: Git version 2.62.2.

Step 3: VCS -> Import into Version Control -> Create Git Repository. Unlike in Eclipse, I created my own repository from Android Studio instead of on GitHub.

Figure 5.3: Create Git Repository.

Step 4: Create a Git Repository. Choose the right project folder.

Figure 5.4: My Android Studios Project folder contains folders of each individual projects.

Step 5: Right click on the project folder (app), Git -> Add.

Figure 5.5: Add to Git.

Step 6: VCS -> Import into Version Control -> Share Project on GitHub.

Figure 5.6: Share Project on GitHub.

Step 7: Insert GitHub username and password.

Figure 5.7: Log in to GitHub.

Step 8: In the next tab, commit and push the files that I wanted.

Figure 5.8: Commit and push.

Troubleshooting: Unused Remotes

VCS -> Git -> Remotes, then removed unused remotes. The reason why I want to remove unused remotes is because it could cause errors when I try to commit and push with a new remote.

Figure 5.9: Find Git remotes.

A Git Remotes pop up appears, select the unused remotes, then click on the “-” button to remove unneeded remotes.

Figure 5.10: Remove unused Git remotes.

Final Notes

As Eclipse, Android Studio’s IDE always changes, so this way of uploading files to GitHub may not stay the same.

Leave a comment

Design a site like this with WordPress.com
Get started