How to link Android Studio with Github

How to link Android Studio with Github

This article is for github beginners or for those who find it difficult to upload android projects on github.

Image for post

  1. Install Git on your computer

Visit this official site to download git on your computer. Once you do that, you can start using it with android studio.

2. Enable Version Control Integration on android studio

Image for postGo to Menu>VCS>Enable Version Control IntegrationImage for postAfter that,select Git as your version control system

> On doing this,you will notice that all your files will turn red.

Image for post

3. Share on Github

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

Image for post

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

Image for post

4. Push your project files on Github

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

Image for post

5. Make changes

Your project is now under version control and shared on Github,you can start making changes to commit and push. You can see I added a new ImageView reference to the MainActivity.java. Notice that after I made the change, the MainActivity.java file turned blue. That means the file now has uncommitted changes (and it doesn?t match the file in the Github repository).

Image for post

6. Commit and Push

Its upto you now when you want to do commit and push. You can do it after every new change or after a lot of changes.

To commit and push,go to Menu>VCS(with green up arrow)

Image for post

After that,you will see a commit changes window and you have to write a commit message (mandatory) and then press on commit and push.

Image for post

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

Image for post

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

I am a recipitentof Udacity?s Google India challenge scholarship and I wrote this article to help my peers. Do clap if you find this useful.

20