Version Controlling: Git and GitHub concepts

github.jpg Originally Posted On...

Version Control Software keeps each and every modification in some special kind of storage/Data Source/Database. If someone wants to roll back a previous change or get some deleted piece of code or anything from the past, he/she can get it from version control.

What is Version Controlling In A Nutshell, Version Controlling means Keep Track of the modifications and versions/file changes of your project in a collaborative workflow.

Version Control Software keeps each and every modification in some special kind of storage/Data Source/Database. If someone wants to roll back a previous change or get some deleted piece of code or anything from the past, he/she can get it from version control.

There are two primary types of version control tools:

- Distributed - Centralized

Here Are Some VCS listed below

**GIT

  • Mercurial
  • SVN (Apache Subversion)
  • CVS (Concurrent Versions System)**

In This Blog, We will See about GIT and GitHub GIT (/ɡɪt/)

First of all, Git is not an acronym or short form of some term, it's itself a word. Git is a Version Controlling software used for tracking changes in any given folder or set of files. Usually, we use it for coordinating work among team members of the project. And to keep track of file modifications by each contributing person.

Git was created by Sir Linus Torvalds for the Linux Kernel to contribute to other kernel developers.

How Does Git Work?

To understand How it works Let’s First understand its key terms.

Repository

A repository (repo) is a group of folders and files that you want to track modifications for your source control. After you initialize git in a folder you can be able to see a new folder with the name “.git” created in the directory. If you cannot see this folder please enable show hidden files.

Please Do Not edit or delete this folder, otherwise, you will lose your past changes. Commit

A commit, or "revision", is an individual change to a file (or set of files). When you make a commitment to save your work, Git creates a unique ID (a.k.a. the "SHA" or "hash") that allows you to keep a record of the specific changes committed along with who made them and when. You can Enter the Commit message while you are committing changes, Commit Messages are important as they will allow you and your collaborators to remember the state of your repo when that commitment is made. Branch

A branch is a pointer to a specific commit. The branch pointer moves along with each new commit you make and only diverges in the graph if a commit is made on a common ancestor commit. There are various commands you can take in Git to work with your branches.

Good practice encourages working from other branches and leaving the master branch clean. By creating a branch separate from to master and working from that, you can make changes without affecting the main progression line of the repository.

Branching is very useful when more than one person is working on a project. Individuals can work on their own branches and later merge them onto the master branch.

That's All for Git for now. We will be doing some hands-on work in the Future. Let’s See about GitHub Now.

GITHUB

Github And Git are two separate things in the software world. Let's see the difference.

Git is a Version of Controlling Software That resides on your local machine.

GitHub is an Online Hosting platform for GIT Repositories. There are some other platforms like GitLab, bitbucket.. etc.

The benefit of using Github is that you can host your repositories online. And share and collaborate on your team’s work.

When a repository is created and used in a single machine it is called a local repository. When a git repository is hosted online it is called a “Remote repository”.

You can sync your local repo with your remote repo to push your committed code or changes in your filesystem so other users can pull your work and validate and integrate it into them.

Also, it serves as a backup of your repository. If something happens to your local machine. You still have your last committed and pushed changes to your work hosted online.

You can create publicly accessible repos or private repos. Private repos can be accessible to you and your team members whom you have invited.

Public repo is accessible to everyone on GitHub. You can also get to see others' public repo and take inspiration from them and you can publish your public repos to help others with your code. And build your project portfolio.

This was a short introduction to VCS, GIT, and GITHUB.

Don't get confused with the words like repo, commit, push, pull, integrate.. etc in the next blog we will check out how you can create a local repository. How to commit changes, manage branches, create a remote repo and push and pull your local repo.

References : en.wikipedia.org git-scm.com github.com