Reading Time 2 minute
In this blog we will go through GitHub setup and create a simple repository. Once we have done this we will clone the repository locally and then push to the repository from our local drive. This should give us a basic understanding of how GitHub works.
Setup GitHub Respository
The first thing we have to do for our GitHub setup is to navigate to the GitHub site.
Navigate to github.com Once there you can simple either sign up for a free account Or log into your existing one
Now go ahead and click on either ‘Start Project; or the ‘New Repository’ button and this will give you the option to create a new repository.
Once done we now have a simple repository. Now let’s go ahead and use Git Bash to clone the repository in our local environment and then push.
Setup Git Bash
Let go ahead and download Git Bash. Git Bash it a terminal which provides many helpful hints on using Git.
To download Git Bash simple navigate to: https://git-scm.com/downloads
Now go ahead and download the client of your choice and install Git Bash.
Once done navigate to the directory of your choice and clone the respository using git clone along side the URL of your project.
Pushing to Repository
Once you have a copy of your project locally make a simple change to your project.
Now we can try to push. To do this first ensure that you have set the following two variables:
git config user.name "qashahin" git config user.email "email@example.com"
Now let’s try to push to our repository, to do this follow the instructions below:
git add . git commit -m "My first commit" git push
Now go back to your browser and look at your repository and you should have successfully pushed your changes into your new project.
Follow the video tutorial below to see a more detailed view of this blog.