What is GIT?

What is GIT?

What is git? How it works? Do you now how git keep history of our code?

·

2 min read

What is GIT?

Git is a version control system. The most widely used modern version control system in the world today is Git. It is an actively maintained open-source project originally developed in 2005 by Linus Torvalds.

What is Version Control System?

The version control system is a tool that helps for detecting and keep tracking changes made to the files. Git is one of the tools for version control. GIT is a version control system tool to help record the changes in files.

GIT

How version control manages using the tool called git is shown in the following illustration.

What is the git local and remote?

Local: It is the developer's local machine. We install the git tool on our local machine to use the version control system on our computer.

Remote: It is the cloud. GitHub is a good example of a cloud service for remote repository maintenance.

Anyone who has access to the remote can make a copy from the remote to the local.

First, we talk about what is git local.

Git local

Git local has mainly four sections.

  • Local repository

  • Index

  • Workplace

  • Stash

Git remote

List remote branches.

Commonly used git commands

  • Clone repository onto the local machine
git clone <repository url>

  • List which files are staged, unstaged, and untracked
git status

  • Staged the file with changes.
git add .  |  git add <file name>

  • Commit the staged snapshot, but instead of launching a text editor, use it as the commit message.
git commit -m <'commit messgae'>

  • Push the local changes into the remote repository
it push <branch name>

  • Join two or more development histories together.
git merge <branch name>

  • Show logs with differences each commit introduces.
git log

Thank You! ❤️