Git on Android Studio (GoAS)

This article is specifically for beginners or for those who are still having difficulty uploading their Android projects to GitHub.

1. Install Git on your computer

Use  this guide  to complete the installation steps of git on your computer. Once you do, you can start using it with Android Studio.

2. Enable Version Control Integration on Android Studio

Go to Menu >> VCS >> Enable Version Control Integration

After that, select Git as the versioning control system.

When you do this, you will notice that all your files turn red.

3. Share to Github

Now go to VCS >> Import into Version Control >> Share project on Github.

Now give a name to your repository and write a description if you want.

4. Push your Project Files to GitHub

Now select the files you want to share and press Ok. You can also write a specific commit message and once you do that, all your files will turn white.

5. Make changes

Your project is now under version control and shared on GitHub, you can start making changes to commit & push. As you can see that I have added a new ImageView to MainActivity.java. Notice that after I made the changes, the MainActivity.java file turned blue. That means that the file has uncommitted changes (meaning it is not yet in sync with the repository / uncommitted file).

6. Commit & Push

Now it's up to you, whether you are sure you want to commit & push immediately or still want to review the code changes again, because you still have that opportunity in this session.

When you are starting to feel confident and sure, just commit & push by clicking Menu >> VCS (green arrow up).

After that, the Commit Changes window will appear and you have to write the commit message (mandatory), then you can press the commit & push button.

After that, you will see another push window. Just press the push button and all the changes will be reflected in your repository.

Congratulations on setting up your first project complete with version control. Yayyyyy!!!

Reference:

https://medium.com/code-yoga/how-to-link-android-studio-with-github-312037a13b99


Post a Comment

Previous Next

نموذج الاتصال