Skip to content

Latest commit

 

History

History
44 lines (29 loc) · 2.89 KB

File metadata and controls

44 lines (29 loc) · 2.89 KB

Text

If you are working on a project over time, you may want to keep track of what changes were made, by whom, and when those changes were made? This becomes increasingly important if you have a bug in your code! Git can help you with this.

Git is a version control system and in this lesson we will learn more about that.

What is Version Control System?

As we all know, any software product is developed by several engineers. A version control system helps these developers to track and manage changes done to the software code. So they can simultaneously work on the same project without interfering with another person's work.

Usually, most people get confused between Git and GitHub. They think both are the same. But that's not true. Git is a Version Control System that you can install on your computer to manage source code. In comparison, GitHub is a hosting service for projects that use git.

What you can do with Git?

With git, you can:

  • Record changes in your project and its files
  • Revert to previous state of a file at different points in time
  • Collaborate with multiple people on one codebase
  • See changes over time
  • Develop multiple features at once

What is a repository?

A repository, or a git project is an entire collection of files and folders associated with a project, along with each file’s revision history. The file history appears as snapshots in time called commits. Multiple commits can be organised into multiple lines of development called branches.

Using the command line, a git repository allows us to: interact with the file's history, clone a project, create branches, commit changes to a file, compare changes with other versions of a file, and more.

How GitHub fits in?

GitHub is a Git hosting service that allows us to share a project with other developers.

GitHub brings collaboration directly into the development process. Work is organised into repositories, where developers can outline requirements or direction and set expectations for team members. Then, using the GitHub flow, developers simply create a branch to work on requirements, commit changes to save them, open a pull request to propose and discuss changes, and merge pull requests once everyone is on the same page.

Install git in your system and create a GitHub account

First of all, you should install git on your system if you haven't done that already. On Ubuntu Linux, you'll simply need to type in the command sudo apt-get install git, and that'll take care of installation.

If you're using macOS, you should already have git installed on your system - no additional step should be required.

On Windows, git comes by default with WSL.

To check the current git version, run the following command in the terminal:

git --version

Secondly, signup for a new GitHub account here.

Great! Now you have both Git and GitHub ready. See you in the next lesson.