logo

Introduction to Git

Git is a free and open source distributed version control system designed to handle everything from small to massive projects with speed and efficiency.

Why Learn This?

Save States (Commits)

Git literally tracks every line of code you change locally. If you break your application, you can safely revert your files back to the exact hour they worked.

Branching Mechanics

Developers can create an isolated "branch" to experimentally build new features without risking destruction to the stable "main" code.

Team Collaboration

Combined with GitHub or GitLab, multiple developers can work simultaneously on the same project and elegantly cleanly merge their code together.

How to use Git

Git is a terminal command-line tool. You initialize it inside your project folder.

Standard daily workflow:
commands.sh
1# Initialize repository (one time) 2 git init 3 4 # Stage all changed files for a commit 5 git add . 6 7 # Lock the changes into history with a message 8 git commit -m "Fixed the login button bug" 9 10 # Push code to cloud (GitHub) 11 git push origin main

Official Learning Resources