Menu
×
     ❯   
HTML CSS JAVASCRIPT SQL PYTHON JAVA PHP HOW TO W3.CSS C C++ C# BOOTSTRAP REACT MYSQL JQUERY EXCEL XML DJANGO NUMPY PANDAS NODEJS DSA TYPESCRIPT ANGULAR GIT POSTGRESQL MONGODB ASP AI R GO KOTLIN SASS VUE GEN AI SCIPY CYBERSECURITY DATA SCIENCE INTRO TO PROGRAMMING BASH RUST

Git Tutorial

Learn Git

[+:

Git is a tool that helps you:

  • save and manage different versions of your files and code.
  • work with others, keep track of changes, and undo mistakes.

Where to use Git?

Git works on your computer, but you also use it with online services like GitHub, GitLab, or Bitbucket to share your work with others. These are called remote repositories.

In this tutorial, you'll learn how to use Git for your own projects and how to connect with remote repositories online.


Learning by Examples

In this tutorial, we will show you Git commands like this:

Example

git --version
git version 2.30.2.windows.1

For new users, using the terminal view can seem a bit complicated.

Don't worry! We will keep it really simple, and learning this way gives you a good grasp of how Git works.

In the code above, you can see commands (input) and output.

Lines like this are commands we input:

Example

git --version

Lines like this are the output/response to our commands:

Example

git version 2.30.2.windows.1

In general, lines with $ in front of it is input.

These are the commands you can copy and run in your terminal.


Tip for Beginners: Don't worry about making mistakes!

When you use Git on your own computer, you can't really break anything important.

Experimenting is a great way to learn, and you can always undo or redo changes as you go.



What Changes When You Switch Platform?

The tutorial can show examples for GitHub, GitLab, or Bitbucket.

The Git commands are mostly the same, but some steps (like connecting to a remote or pushing code) might look a little different depending on the platform you choose.

Use the menu to see examples for each platform.


Why Practice with Exercises?

Practicing with exercises helps you remember the commands and understand how Git works.

Try the exercises and quiz to test your knowledge!

Exercise?What is this?
Test your skills by answering a few questions about the topics of this page

Drag and drop the correct code to check your installed Git version.
git -- ;
version
install
help



Git Quiz

Test your Git skills with a quiz.

Start Git Quiz


Track Your Progress

Create a free W3Schools account and get access to more features and learning materials:

  • CheckmarkView your completed tutorials, exercises, and quizzes
  • CheckmarkKeep an eye on your progress and daily streaks
  • CheckmarkSet goals and create learning paths
  • CheckmarkCreate your own personal website

Sign Up for Free

Note: This is an optional feature. You can study at W3Schools without creating an account.


×

Contact Sales

If you want to use W3Schools services as an educational institution, team or enterprise, send us an e-mail:
sales@w3schools.com

Report Error

If you want to report an error, or if you want to make a suggestion, send us an e-mail:
help@w3schools.com

W3Schools is optimized for learning and training. Examples might be simplified to improve reading and learning. Tutorials, references, and examples are constantly reviewed to avoid errors, but we cannot warrant full correctness of all content. While using W3Schools, you agree to have read and accepted our terms of use, cookie and privacy policy.

Copyright 1999-2025 by Refsnes Data. All Rights Reserved. W3Schools is Powered by W3.CSS.