Přejít k obsahu
BeoHosting
BeoHosting

Version control for programmers and web developers

What Is Git?

A detailed explanation of Git — what repositories, branches and commits are, what GitHub and GitLab are, and how developers use Git to deploy and maintain websites.

BRZI ODGOVOR

What is Git?

Git is a distributed version control system (DVCS) that tracks changes in code over time. It allows multiple developers to work in parallel, builds a history of all changes, enables branching for feature work and rollback to previous versions. Core commands: init, clone, add, commit, push, pull, branch, merge. Platforms: GitHub, GitLab, Bitbucket. BeoHosting cPanel has Git Version Control for auto-deploying code to the server via a webhook.

  • Git = code version control
  • Repositories, branches, commit, push
  • GitHub/GitLab/Bitbucket platforms
  • BeoHosting cPanel: Git Version Control
  • Auto-deploy with a webhook

Tým BeoHosting

10+ let zkušeností — Specialisté na webhosting a infrastrukturu

Naposledy aktualizováno:

What is Git and why do all developers use it?

Git is a distributed version control system (VCS) created by Linus Torvalds in 2005 — the same person who created Linux. Git tracks every change in your code and lets you return to any previous version at any moment.

Imagine you are writing a document and want to save every version — Git does that automatically for your code. Every change is recorded with a description, an author and a timestamp. If something goes wrong, you can instantly revert to the last correct version.

Git je danes industrijski standard — uporablja ga več kot 90% programerjev po svetu. Od majhnih freelance projektov do Googla, Facebooka in Microsofta je Git osnova vsakega resnega razvojnega procesa. Z VPS gostovanjem BeoHosting lahko nastavite Git-based deployment za samodejni deploy vaše strani.

Core Git concepts

Understanding these 6 concepts is enough to start working with Git.

Repository (Repo)

A folder that contains your project and the complete history of all changes. It can be local (on your computer) or remote (on GitHub/GitLab). Each project usually has one repository.

Commit

A snapshot of your code at a particular moment. Each commit contains the changes, a message describing them, an author and a timestamp. Commits form the "timeline" of your project.

Branch

A parallel line of development. The main code is on the "main" branch. When you want to add a new feature, you create a new branch, make changes, and when finished, merge it back into main.

Merge

Combining one branch into another. When you finish work on a new feature in your branch, the merge combines it with the main code. Git automatically resolves most conflicts.

Pull Request (PR)

A request to merge your branch into the main branch. The team can review your changes, comment, request fixes and finally approve the merge. Key to teamwork.

Clone / Fork

Clone makes a copy of the repository on your computer. Fork makes a copy on your GitHub account. Fork is used for contributions to open-source projects — you fork, make changes, then send a Pull Request.

GitHub, GitLab and Bitbucket — Git hosting platforms

These platforms host your Git repositories in the cloud and add features for teamwork.

GitHub

100M+ users

The most popular platform with 100+ million users. Owned by Microsoft. Ideal for open-source projects, portfolios and collaboration. Free for public and private repositories.

GitLab

30M+ users

A complete DevOps platform with built-in CI/CD, a container registry and monitoring. Popular in enterprise environments. It can be installed on your own server (self-hosted).

Bitbucket

10M+ users

Atlassian's platform that integrates excellently with Jira, Trello and Confluence. Popular among teams that already use Atlassian tools. Free for small teams (up to 5 users).

How developers use Git to deploy a website

Git-based deployment is a modern approach that automates putting code onto the server.

1

Local development

The developer writes and tests code on their own computer. They use Git to track all changes.

2

Commit and Push

When satisfied with the changes, the developer commits the code and pushes it to GitHub/GitLab.

3

Code Review

The team reviews the changes through a Pull Request. They comment, suggest improvements and approve the merge.

4

CI/CD Pipeline

Automated tests run. If all tests pass, the code is automatically deployed to the staging/production server.

5

Deploy to the server

The new code is live on the server. If a problem appears, Git enables an instant rollback to the previous version.

Za Git-based deployment je potreben strežnik z dostopom SSH — VPS gostovanje BeoHosting vam s korenskim dostopom omogoča popoln nadzor nad strežnikom, idealen za postavitev CI/CD pipeline in avtomatiziran deploy.

The most important Git commands to start with

These 10 commands cover 90% of daily work with Git. All commands are entered in a terminal (Command Prompt, PowerShell or Terminal on Mac).

git initInitializes a new Git repository in the current folder
git clone <url>Downloads (clones) a repository from GitHub/GitLab to your computer
git statusShows the status of changes — which files are modified, added or deleted
git add .Adds all modified files to the staging area (preparation for a commit)
git commit -m "message"Saves the changes with a descriptive message — creates a new "snapshot" of the code
git pushSends your commits to the remote repository (GitHub/GitLab)
git pullFetches the latest changes from the remote repository to your computer
git branch <name>Creates a new branch for parallel development
git checkout <branch>Switches to another branch
git merge <branch>Merges the specified branch into the current branch

Máte dotaz?

Náš tým je k dispozici 24/7. Zavolejte nám nebo nám napište.

Připraveni spustit svůj web?

SSL ochrana
Rychlost
Podpora 24/7

Připojte se k více než 4 000 spokojeným zákazníkům. Bezplatná migrace a 15denní záruka vrácení peněz.

15denní záruka vrácení peněz
Bezplatná migrace15denní zárukaPodpora 24/7

Frequently asked questions about Git

Odpovědi na nejčastější dotazy o našich službách.

Git is a version control system — a tool that remembers all the changes in your code. Imagine Google Docs but for code — every change is saved, you can return to any previous version, and several people can work on the same project at once without conflicts.

Git is a tool (software) for version control that runs locally on your computer. GitHub is an online platform (service) that hosts Git repositories in the cloud and adds features such as pull requests, issues, CI/CD and collaboration. You can use Git without GitHub, but GitHub requires Git.

For a simple WordPress site or a static site, Git is not mandatory, but it is very useful. Git lets you track all changes, safely test new functionality in branches and easily revert to a previous version if something goes wrong. For professional projects, Git is the industry standard.

A typical workflow: the developer makes changes locally, commits them to Git, pushes to GitHub/GitLab, where a CI/CD pipeline automatically tests the code and deploys it to the server. This is called Git-based deployment and is used by companies of all sizes — from startups to Google.

A commit is a "snapshot" of your code at a particular moment — like "Save" in a game. Each commit has a unique ID, a message describing the changes, an author and a timestamp. You can return to any previous commit and see the exact code as it was at that moment.

Naše záruky pro váš klid

Chráněni ze všech stran

15denní záruka

V prvních 15 dnech vracíme peníze bez otázek.

Bezplatná migrace

Váš web přemigrujeme bez výpadku — vy neuděláte nic.

Podpora 24/7

Naši odborníci jsou tu 24/7 prostřednictvím ticketů a live chatu.