Skip to main content

Learn Git & Github - 2

Learn Github: Lesson-2

Difference between git and github

In the first lesson we learned how git works, Now we will see what is github. People often get confused between git and github. These two are entirely different things providing the same functionality. The major difference between git and github is that git works on your machine and github is a cloud service. You can see github as a cloud version of github where an entire team can work on a project. So there is not a point of choosing either one of them. You use git only if you have a project on which you are working alone and then you use github along with git if you are handling a team project. Its not mandatory to have a team to use github. If you want to share your code to people then you can push/upload it to github also. Don't worry about getting it changed by developers because the project will be in your hands and you will be the person to choose which changes should your project accept.

Getting started with Github

Lets see how can we use github. There are 2 reasons to get to github.

  • Either you want to work on an existing github project
  • You want to start your own project and want to share it with the world.

Work on existing github project

So we'll consider the first reason first. Suppose you want to work on an existing project. Then you'll definitely have your desired project url but in case you haven't decided yet then you can go to this Fetch-info Github Tutorial repository (Open it in a new tab so you can go along). Every project uploaded on github is called a repository. Now when you have opened the wep page. The first thing to do is "Fork the project" by clicking a button "Fork" on right side in the top See Image. When you fork a project, github creates a copy of that project under your account which you can modify anytime but those changes won't reflect in the original project.

Lets assume that you have forked the project and now the code url will be something like https://github.com/your-username/fetch-info-github.Now check a text field containing a link aside a button "Download Zip" See Image. Copy the link from the field. Its the link from which you can download that project on your machine. Downloading a project is called cloning in github terminology.

Once you have copied the link, open your terminal/git-bash on your machine and go the directory where you want to download your project. Now type git clone your-link. Now git will download the project along with the edit history of that project which means all of its commits history. Go to your forked project webpage and see a drop-down menu in left with label "branch" See Image. If you click it then you will see that there are more than one branch. One branch being the master and other being alpha if you have forked my dummy repository. Now go back to terminal and change your directory to your project name which git downloaded.

Once inside the directory, type git branch. You will notice that there is only one branch "master". Its advantageous becuase all other branches are normally either for testing or development. The branch which matters is "master". So you have your project set up on your machine. You can type git log to see what commits have been happened. This is just set up. Main development on that project will continue later when we'll be discussing about git commands so sit tight. Also these steps are for people who want to contribute to existing projects. Those who want to create a new project read the next section.

github-buttons

Creating a new project on github

Creating a new project on github is not a difficult task to do. Just click the "+" button on the top right corner of the webpage aside your "profile pic" See Image. There you will be presented with many options but we'll click "New Repository" because we want to create a project. When you will click the "New Repository" button, a page will open which will ask for project name. Enter the name which doesn't exist earlier. Now add description of your project. Public repositories is our option because we haven't paid for the private service. Now if you want a Readme file in your project which will contain the description then click "Initialise with Readme". Choosing a licence is very important if you are doing some series development. Here is something which can help you Choose License But if you are doing some basic development then you can choose MIT license which distribute your project for research purposes.

github-create-repo-screen

When you have done all this then click "Create Repository". Then you will have your project. Now check a text field containing a link aside a button "Download Zip". Copy the link from the field. Its the link from which you can download that project on your machine. Downloading a project is called cloning in github terminology.

Once you have copied the link, open your terminal/git-bash on your machine and go the directory where you want to download your project. Now type git clone your-link. Now git will download the project along with the edit history of that project which means all of its commits history. This is just set up. Main development on that project will continue later when we'll be discussing about git commands so keep following this guide.


Okay folks. Now you have set up your project. In the next lesson, we will study some basic git commands and will use them to develop our project further.


Comments

Popular posts from this blog

Image Search Engine Using Python

Images provide a lot more information than audio or text. Image processing is the prime field of research for robotics as well as search engines. In this article we will explore the concept of finding similarity between digital images using python. Then we will use our program to find top 10 search results inside a dataset of images for a given picture. It won't be as good as google's search engine because of the technique we will be using to find similarity between images. But what we are going to make will be pretty cool. So lets start. Setting up the Environment Our Algorithm How the code looks Lets build the GUI Additional Techniques Setting up the Environment The code we are going to write requires a few tools which we need to install first. I will try to be as precise as i can and if you get stuck into installing some tool then you can drop a comment below and i will help you sort out the problem. So here are the tools and the steps to install

Understanding Python Decorators

If you have ever wondered what those @something mean above a python function or method then you are going to have your answers now. This @something line of code is actually called a decorator. I have red from various articles about them but some of them were not able to clarify the concept of a decorator and what we can achieve with them. So in this post we'll learn a lot about python decorators. Here is a list of topics we'll be covering. What is python decorator Understanding the concept Multiple decorators on same function class method decorator Where can we use decorators What is python decorator A python decorator is nothing but a function which accepts your given function as a parameter and returns a replacement function. So its like something this def decorator(your_func): def replacement(your_func_args): #do some other work return replacement @decorator your_func(your_func_args): #your_func code Now when your_func gets called then

Cordova viewport problem solved

Include the viewport settings in Cordova If you are facing the auto zooming problem of cordova then go read on the full article. Cordova actually ignores the viewport meta tag which causes the pixel density problem. So we need to tell cordova that viewport tag is equally important as other tags. To do this, we need to add some code to a file which is specify in the article. Corodva messes with pixels If you are using the latest cordova version or creating the cordova app for latest android versions then you may have faced the zoom malfunctioning.I also faced it when creating an app. Many of you may have already searched the web and found the answer of changing the meta tag attributes to get it working. But adding target-densitydpi=medium-dpi does not solve the problem for latest android versions. It may work for gingerbread but not for kitkat and others. So the final solution which i found was one of the stackexchange answer but rarely found. So i am gonna two things here, i