Free Shipping

Secure Payment

easy returns

24/7 support

  • Home
  • Blog
  • An Intro to Git and GitHub for Beginners – Part 01

An Intro to Git and GitHub for Beginners – Part 01

 July 13  | 0 Comments

History behind the Github

⦁ File System Handled Before Centralized System
⦁ Centralized System
⦁ Distributed System
⦁ Differences between Centralized and Distributed System

File System Handled before – Centralized System

⦁ In the era of 20th Century, there was a big concern with the record management.
⦁ physically separate file collection can create extra work in terms of management and file retrieval.
⦁ For this reason, record managers wanted to adopt the centralized system. This can not only solve a lot of work but also have the potential to disrupt business activities.

Centralized System

Advantages of Centralized System
⦁ Business process efficiency
⦁ Space Savings
⦁ Improved Security
⦁ Improved Compliance
⦁ Minimizes the time-consuming process of searching or fetching the records
Disadvantages of Centralized System
⦁ Single point of failure could bring down the entire System
⦁ Higher initial setup cost
The Following image can clear you everything

Distributed System

A distributed system consists of a collection of autonomous computers, connected through a network and distribution middleware, which enable computers to coordinate their activities and to share the resources of the system so that users perceive the system as a single, integrated computing facility.
The Following image can make you have a clear understanding of Distributed System

Differences Between Centralized System and Distributed System:

Centralized System Distributed System
Centrally the data is located at one place for i.e. a desktop or server CPU Data is Distributed in every system i.e. Every cloning is the backup of data
Remote commits are slow Remote commits are very speed
There is the single point of failure in the centralized server No point of failure since the data is duplicated in every other system
Unsolicited changes that may break your builds. No Chance of breaking your builds
Merging of code is painful Merging is easy
Developers cannot push their code Continuously Developers can push their code continuously

There is evaluation in every technology. The 21st century has led to the evolution of Github. Below here is the introduction of Github

Overview:

This blog can help us to understand the overall functionalities, usage and its importance of Github in the IT Market.
Github offers all of the distributed revision control and source code management(SCM) functionality of Git, as well as adding its own features. Github provides a web-based graphical interface for desktop as well as mobile integration.
Below image can give you an outline of the History of Github

Github Key elements for Beginners:Android Programming

⦁ What is Github?
⦁ Common words used when using GitHub
⦁ Introduction to Git and its flow

What is Github?

Here I will explain you with the ease of diagram

Illustration
⦁ The above figure is divided into two colors one is blue and one is green.
⦁ Blue color is the cloned repository and the green color is the Main repository.
⦁ Blue color is the development Site where the development and maintenance of the projects are going on.
⦁ Main repository is the Live Site where Software product is released and goes live in action.
⦁ In the figure, we can see both the repositories are connected to the same account.
⦁ Special feature of distributed system is that the same account can be handled by more than one person.
⦁ In the scenario, if we can consider for a while, what the developer is handling is the cloned repository and he wants to push the code from his own end.
you can see that the major code changes are submitted to the site admin for approval.
⦁ Approved content is merged into the main repository which is maintained by the site admin.
⦁ At this time a full responsibility of site admin is to ensure that the new changes are not breaking the live website.
⦁ Before merging the code, the site admin also reviews code before accepting or rejecting changes.
⦁ If any rejected changes found, then it is sent back to the developer.
Android Programming

Common words used when using GitHub

⦁ Commandline
⦁ Repository
⦁ Version Control
⦁ Commit
⦁ Branch

Commandline

⦁ It’s a computer program, we use to input Git commands.
⦁ On a Mac, it is a terminal and on a PC it is a non-native program (command prompt).
⦁ In both the cases you type text-based commands, known as prompts, into the screen, instead of using a mouse.

Repository

⦁ A directory or a storage where your projects can go live.
⦁ Sometimes it is also called a repo.
⦁ It can be local to a folder on your computer, or it can be a storage space on GitHub or another online host. For example- you can keep text files image files etc .

Version Control:

⦁ It is designed for the Git to serve.
⦁ It keeps “snapshots” of every point in time in the project’s history, so you can never lose or overwrite it.

Commit:

⦁ It is a very important terminology which gives the power to Git.
⦁ When you commit the code you actually take a snapshot of your project. This gives you a checkpoint so that you can reevaluate or restore your project to any of the previous states.

Branch:

⦁ Git provides a powerful way of branching the projects.
⦁ In this, multiple developers working on the same project will “BRANCH OFF” their main project with the own full versions of changes what they have made.
⦁ After they are done with the changes multiple developers will merge their code.

Introduction to Git and its Flow  & Setting the Github for the first time

Steps
⦁ Login to the below link
https://github.com/
The below is the signup page you get
⦁ All you have to do is to sign up into the Github account. It is as easy as signing up for gmail.com or yahoo.com.
Now if you want to use the Git on your projects then download Git for windows or Linux.
You have to install Github on your local computer as it will not work on local computer
Below are the screenshot and the link which can help you to navigate to the download screen after
https://git-scm.com/downloads

That’s all for sign-up.
Congrats you are done with the sign-up.
After Signing up you will have to navigate the link provided above to download Git Bash
Once done through signup and downloading Git Bash
Next Step is to go with the below steps

CREATING YOUR ONLINE REPOSITORY

Please go through the following steps:
Step 01: Log in to github.com and put your credentials which you have used in signing up as shown below image

Step 02: After logging in you will get the following screen page and you get a green Button called as NEW REPOSITORY

Step 03: After hitting on to the new repository the following screen you get

Step 04: After clicking on the create repository the following screenshot you get

Open the Git bash for the basic commands execution. All set, we can start

git config

⦁ It lets you get and set configuration variables that control all aspects of how Git looks and operates.
⦁ We have to do it once Since Git commit uses this information.
⦁ Have a look at the below screenshot

git init

⦁ It is used to initialize the Git repository.
Have a look at the below image

git clone

⦁ It is used to get a copy of the existing Git repository
Have a look at the below screenshot

I have added two files in the local repo manually. Have a look at the below screenshot

Now we need to add these two files to the repo.

git add

⦁ This command will help you to add your files to the repository

git push

⦁ Observe few things when you clone the local repo you are trying to commit and push entire local repo to the remote
Find the below screen shots

Inside this folder I have

You can observe the two files small.txt and Big.txt,my two text files should be in the remote. Look at the below screenshots along with the commands

Check out the result

git pull

⦁ It will update your local repo and also keep update in sync with the Online repo
⦁ Take a look below

git commit and push

⦁ Take a look at the below screenshots

Final result

Conclusion

This blog will help will be the best for beginners who can explore the world of GitHub using the Git for the first time and also explores the Git basic commands.
Hope you liked it!!!
To become a Certified Android Developer Click Here And Stay tuned for the Next Blog
If you have any queries then you can mail us @ support@acadgild.com

>