Learning & Working with GIT






What is version Control?

Version control systems are a category of software tools that help a software team manage changes to source code over time.
Version control software keeps track of every modification to the code in a special kind of database.
If a mistake is made, developers can turn back the clock and compare earlier versions of the code to help fix the mistake while minimizing disruption to all team members of a developing team.

Benefits of Version Control

  • Version control protects source code from both catastrophe and the casual degradation of human error and unintended consequences.

  • Version control systems facilitate a smooth and continuous flow of changes to the code rather than the frustrating and clumsy mechanism of file locking.

  • Version control can also enable developers to move faster and it allows software teams to preserve efficiency and agility as the team scales to include more developers.

  • A complete long-term change history of every file is provided. This means every change made by many individuals over the years. Changes include the creation and deletion of files as well as edits to their contents.

  • VCS tools keeps multiple streams of work independent from each other while also providing the facility to merge that work back together, enabling developers to verify that the changes on each branch do not conflict.

  • Traceability. Being able to trace each change made to the software and connect it to project management and bug tracking software such as Jira.

What Is GIT?

As known to all of us , GIT is a Distributed VCS (Version Control System). So far it is the most widely used modern version control system in the world.
It was originally  developed in 2005 by, Linus Torvalds,the famous creator of the Linux Operating System kernel.
Git works well on a wide range of operating systems and IDEs.

GitHub is a web-based hosting service for version control using Git. It is mostly used for software development and sharing. It offers all of the distributed version control and source code management functionality of Git as well as adding its own features.

Working with GIT....

1.Creating a Git Hub Account.

You can create a Git Hub account by visiting www.GitHub.com  by using your current email address.

2.Setting Up a Repository

repository is usually used to organize a single project. Repositories can contain folders and files, images, videos, spreadsheets, and data sets – anything your project needs. We can also include a README file to include data about the project.

To create a new repository,
  1. In the upper right corner, next to your avatar or identicon, click  and then select New repository.
  2. Name your repository .
  3. Write a short description.
  4. Select Initialize this repository with a README.


3.Creating a Branch
By default your repository has one branch named master which is considered to be the definitive branch. We use branches to experiment and make edits before committing them to master.
When you create a new branch from the master branch, you’re making a copy of the master as it was at that point in time. If someone else made changes to the master branch while you were working on your branch, you could pull in those updates.
Normally developers keep on developing their individual branch and once their work is ready and completed testing they merge those individual projects to the master.

  1. Go to your new repository.
  2. Click the drop down at the top of the file list that says "branch: master".
  3. Type a branch name.
  4. Select the blue Create branch box or hit “Enter” on your keyboard.


4.Commit Changes

On GitHub, saved changes are called commits. Each commit has an associated commit message, which is a description explaining why a particular change was made. Commit messages capture the history of your changes, so other contributors can understand what you’ve done and why.






5.Pull Requests

When you open a pull request, you’re proposing your changes and requesting that someone review and pull in your contribution and merge them into their branch. Pull requests show diffs, or differences, of the content from both branches. The changes, additions, and subtractions are shown in green and red.


 6.Merging a Pull Request

Merging is the concatenation of  a particular branch to the master branch.






Comments

Popular posts from this blog

A Start To Learn Mongo DB

Intro To ReactJS

Building a React CRUD application using MERN stack