Opens in a new tab

Git

Git is a free, open-source, distributed version control system that tracks changes in source code and enables multiple developers to work on the same project at the same time. Created by Linus Torvalds in 2005 for the development of the Linux kernel, Git has become the standard tool for managing code in software and web development.

“Distributed” means every developer has a full copy of the project’s history on their own machine. Work can continue offline, and there is no single point of failure. Teams usually also keep a shared copy on a hosting platform such as GitHub, GitLab, or Bitbucket.

Why It Matters

  • Full history: every change is recorded with who made it, when, and why.
  • Safe experimentation: branches let developers build features without affecting the live code.
  • Collaboration: changes from many developers are merged in a controlled way, usually after code review.
  • Easy rollback: if an update causes problems, the team can return to a previous working version.
  • Deployment automation: Git is the starting point for CI/CD pipelines that test and deploy code automatically.

Core Concepts

  • Repository (repo) → the project folder and its complete change history.
  • Commit → a saved snapshot of changes with a descriptive message.
  • Branch → an independent line of development, such as a new feature or bug fix.
  • Merge / pull request → combining a branch back into the main code, typically after review.
  • Remote → a shared copy of the repository on a server or platform.

Example

A team working on a WordPress plugin uses Git. Each developer creates a branch for a feature, commits changes, and opens a pull request. After review, the branch is merged into main and deployed. If a bug appears, the team can find the exact commit that introduced it and revert it.

git checkout -b feature/gift-card-expiry
git add .
git commit -m "Add gift card expiry date setting"
git push origin feature/gift-card-expiry

Best Practices

  1. Commit small, focused changes with clear messages.
  2. Use branches for every feature or fix, and review code before merging.
  3. Never commit passwords, API keys, or other secrets.
  4. Make sure your company, not only your vendor, owns the repository.