0% found this document useful (0 votes)
60 views1 page

GIT Cheatsheet

This document is a Git cheatsheet that provides essential commands for managing Git repositories, including initialization, cloning, and basic operations like adding and committing changes. It also covers branching, remote repository management, and methods for undoing changes. The commands are presented in a concise format for quick reference.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
60 views1 page

GIT Cheatsheet

This document is a Git cheatsheet that provides essential commands for managing Git repositories, including initialization, cloning, and basic operations like adding and committing changes. It also covers branching, remote repository management, and methods for undoing changes. The commands are presented in a concise format for quick reference.
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 1

GIT Cheatsheet

// Repository
git init // Initialize a new Git Repo

git clone <repo-url> // Clone a Repo from URL

// Basics
git status // Show Changes Status

git add <file> // Add Changes to Staging


git commit -m "Message" // Commit changes with a message

git log // View Commit History

// Branching
git branch // List branches

git branch <branch-name> // Create a new branch

git checkout <branch-name> // Switch to a branch

git merge <branch-name> // Merge changes from a branch

git branch -d <branch-name> // Delete a branch

// Remote Repositories
git remote // List remotes

git remote add <name> <url> // Add a remote

git push <remote> <branch> // Push changes to a remote

git pull <remote> <branch> // Pull changes from a remote

// Undoing Changes
git pull // Fetch and merge changes

git fetch // Fetch changes without merging

git reset --hard HEAD // Discard changes

git revert <commit-hash> // Revert changes in a commit

You might also like