Learn commands, workflows, and IDE integration with our interactive platform
git --version
Alternative installation using Winget:
winget install --id Git.Git -e --source winget
/bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
brew install git
git --version
For Debian/Ubuntu-based distributions:
sudo apt update
sudo apt install git
For Red Hat/CentOS/Fedora:
sudo yum install git
# Or for newer versions:
sudo dnf install git
Verify installation:
git --version
A Git repository contains all of your project's files and tracks changes to those files over time.
Add changes to the staging area to prepare them for a commit using git add.
Save changes to your repository with a descriptive message using git commit.
Create separate lines of development using git branch and git checkout.
Combine changes from different branches using git merge.
Share changes with remote repositories using git push and git pull.
Initialize a new Git repository
git init
Copy an existing repository
git clone https://github.com/user/repo.git
Add files to staging area
git add filename.txt
git add .
Save changes to repository
git commit -m "Descriptive message"
View repository status
git status
View commit history
git log
Reapply commits on top of another base
git rebase main
Temporarily save changes
git stash
git stash pop
Apply specific commits from another branch
git cherry-pick <commit-hash>
Undo commits safely
git revert <commit-hash>
Reset current HEAD to specified state
git reset --hard HEAD~1
Create tags for releases
git tag v1.0.0
$ Welcome to Git Master Terminal! Try some commands:
$ git init
$ git add .
$ git commit -m "Initial commit"
For a full interactive experience, visit our Git Master Terminal page.
VS Code has built-in Git support. The Source Control panel shows all changes in your repository.
Easily switch between branches and create new ones from the status bar.
VS Code provides visual tools to resolve merge conflicts.
Automate tasks with client-side and server-side hooks:
Connect Git with continuous integration pipelines:
Git is a distributed version control system that tracks changes in files and coordinates work among multiple people.
Git is the version control system, while GitHub is a cloud-based hosting service for Git repositories.
Use git reset --soft HEAD~1 to undo the last commit while keeping changes staged.
Open conflicting files, edit to resolve differences, then add and commit the resolved files.