CodeBlanks Logo Icon CodeBlanks

What is Git?

Learn that Git is a version control system and why it is used.

What is Git?

Git is a distributed version control system that tracks changes in files within software projects. Developers can use Git to inspect previous changes, return to earlier versions, and collaborate on the same project. Git makes managing source code safely and efficiently much easier.

git init
git add index.html
git commit -m "First version"

Git is open source and was created by Linus Torvalds, the developer of Linux.

Why is Git important?

When adding a new feature or fixing a bug in a project, it is important to preserve the previous working version. Git addresses this need by storing changes in records called commits. You can also work on separate branches to develop new features without affecting the main version.

git status
git add .
git commit -m "Add navigation"

Using Git makes it easier to track project history and manage teamwork.

Practice Write the first Git commands

Initialize Git in an empty project directory. Then stage the index.html file and create a commit with the message First version. Write the commands in the correct order.

Starter code

terminal
# Git deposunu başlat

# Dosyayı sahnele

# İlk commit'i oluştur

Sample solution

terminal
# Git deposunu başlat
git init

# Dosyayı sahnele
git add index.html

# İlk commit'i oluştur
git commit -m "İlk sürüm"

Expected output

[main (root-commit) a1b2c3d] İlk sürüm
 1 file changed

Questions and answers

Review the lesson questions together with their answers. To test yourself, solve the lesson interactively.

1 What is Git used for?

  • To speed up the internet connection
  • To track changes in files Correct answer
  • To install the computer's operating system
  • To design web pages automatically

Explanation: Git records changes in project files and allows access to previous versions.

2 Complete the type of Git

Question
Git, dağıtık bir ____ sistemidir.
Answer
Git, dağıtık bir versiyon kontrolü sistemidir.

Explanation: Git is a version control system used to manage file changes.

3 Basic Git features

Term Meaning
Git Version control system
Commit Change record
Branch Independent working branch
Open source Software with open source code

All lessons in Beginner