Git

Table of contents

Summarise with:

Git is a distributed version control system which is used to manage and track changes to files within a project, particularly in software projects.

Created by Linus Torvalds in 2005, Git enables developers to collaborate efficiently and maintain a complete history of all changes made over time.

This system is essential in software development, as it facilitates collaboration between teams, ensuring that each member can work on their own copy of the code without interfering with the work of others. As it is distributed, each contributor has a complete copy of the repository, allowing them to work independently without an internet connection.

Git features

  1. Version control: tracks changes made to a project’s files. Each change is recorded as a new version or «commit», allowing you to revert to previous versions if necessary.
  2. Branches: it makes it easier to create branches, allowing you to work on different features or fixes independently. Each branch can be merged back into the main branch (usually called «main» or «master») once the work is complete and tested.
  3. Merger: allows you to merge changes made in different branches. This is useful for combining the work of several developers or merging a new feature into the main branch.
  4. History: users can access the change history, which shows who made which changes and when, along with an optional description of each commit.
  5. Restoration: it allows you to undo changes if something goes wrong, either by restoring a specific file or reverting to a previous version of the project.

How does Git work?

Git works by snapshots of the project rather than tracking changes line by line. Every time a commit is made, Git takes a snapshot of the current state of the files and stores references to those files. If there are no changes to a file, Git simply references the previous file rather than storing a new copy.

This makes Git extremely efficient in terms of storage and speed. Users can clone a repository (create a complete local copy), make changes and then «push» those changes to the central repository.

Git uses three main areas in its workflow:

  1. Working Directory (Working directory): where changes are made.
  2. Staging Area (Staging area): where the files to be included in the next commit are prepared.
  3. Repository (Repository): where all the commits and the project history are stored.

Advantages of Git

Git offers a range of advantages for use, and they are as follows:

  1. Effective collaboration: enables multiple developers to work on the same project at the same time without overwriting each other’s changes.
  2. Distributed: Unlike centralised systems, Git allows each developer to have a complete copy of the repository, which means they can work offline and recover their work from any node in the event of a failure.
  3. Performance: it is quick and efficient when managing large projects involving multiple developers.
  4. Full history: the full project history is available at any time, enabling detailed traceability.

The difference between Git and GitHub

Git is the version control system, whereas GitHub It is a cloud-based platform that hosts Git repositories.

GitHub enables developers to collaborate on projects, store their repositories online and use additional features such as code review, issues (for tracking bugs and tasks) and actions for workflow automation.

Whilst Git is a tool you can use locally, GitHub makes it easier to remote collaboration and provides a graphical interface and additional tools for working with Git.

A project can use Git without being on GitHub, but using both together offers a more comprehensive experience for open-source and collaborative projects.

Share in:

Related articles

Outlier

An outlier is a piece of data or a set of data that deviates significantly from the rest of the observations in a data set. In other words, if you are wondering what an outlier is, it refers to those values that do not

Routing

Routing is the process of determining the path that data must follow through a network to get from an origin to a destination. In the context of systems and networks, routing refers to how

Firewall

A firewall is an essential tool in computer security that acts as a barrier between a private network and the vast world of the internet. Its main function is to protect an organisation's or user's systems and data, acting as a gatekeeper.

DLP

DLP, or data loss prevention, is a cybersecurity strategy and set of technologies designed to protect sensitive and confidential information against unauthorised leaks. Its main objective is to prevent the leakage of critical data, such as financial, proprietary, and other sensitive information.

Scroll to Top