In this video I explain how to use Android Studio to pull a project from Github (otherwise known as cloning a project), how you make changes to that project, commit those changes and then push them back to Github.
Start off by loading up Android Studio. The first thing I'm going to do is choose check out project from version control. As you can see there are lots of different options here. I'm going to choose Github, check out from Github and then I'm going to enter my Github credentials which is my email address and password.
I'm going to uncheck save password but feel free to leave that checked if you're using your own computer.
Now this is going to access my Github account and it's going to pull down the list of repositories that I have associated with my account.
The second one in the list is hello Github, which is a project that I pushed earlier in a previous
demonstration. Select the project, and change the parent directory to have all of my work spaces in one folder. I'm going to leave the directory named as default which is the name of the project.
Make sure everything is filled out correctly and then click clone. This will pull down the code from Github and store it locally on your machine.
As you can see it says you have checked out an Android Studio project would you like to open it? Yes -- open the project in Android Studio now.
As the product is loading you can see gradle is working in the background to open the project.
You’ll be able to see the code files that have been previously checked into Github.
First thing we need to do is enable version control on this project. For some reason Android Studio doesn't by default enable version control when you checkout from Github.
To enable it, all you do is click on VCS and enable version control integration. It will ask you
which version control system would you like to use? Select git because Github uses git, and click ok.
Now it's set up my project to use git as a version control.
Next make a change to the project which we can then commit and push back to Github.
All I'm going to do is change hello world text to read hello London App Developer. The change is made in the strings file. We're going to say hello London App Developer.
Now we can preview the layout.
The next step is to commit these changes to my git repository so we can then push
them to github.
Right click the project name in the top corner, choose git and commit directory. This is going to look at all the files that have changed in my git repository. You can see the list
of files that's changed.
Check all the files and write a commit message, this should be something short
but descriptive to give other people working on the project and yourself an idea of what has changed.
It's up to you how specific you want to go with this message but I like to write something that somebody else can understand.
Next leave everything else as default click commit. It's going to commit the changes to my local git repository so nothing's being pushed to Github just yet. It's only being stored locally.
The next step is we're going to push the changes to Github. Right click hello Github in the top corner, choose git right at the bottom and then choose repository and then click push.
This will bring up the git push screen which is a confirmation screen highlighting what's changed and what we're going to push.
Leave everything as default.
There will be an option to push to an alternative branch. For this tutorial we're just going to push to the master branch (default). Click push. Now it's will push the changes to Github.
It should say: push successful, pushed one commit to master.
Now it's been pushed to Github. Go to your Github page and refresh to see the the two commits and their comments.
And that’s it!
If you like this video check out my tutorials on http://www.londonappdeveloper.com
Learn how to build a backend using Python & Django REST Framework: https://www.udemy.com/django-python