0% found this document useful (0 votes)
4 views2 pages

Git Cheat Sheet

This document is a Git cheat sheet that outlines common commands and their usage. It includes commands for initializing repositories, managing branches, staging and committing changes, and interacting with remote repositories. The cheat sheet serves as a quick reference for essential Git operations.

Uploaded by

cherrygranger1
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)
4 views2 pages

Git Cheat Sheet

This document is a Git cheat sheet that outlines common commands and their usage. It includes commands for initializing repositories, managing branches, staging and committing changes, and interacting with remote repositories. The cheat sheet serves as a quick reference for essential Git operations.

Uploaded by

cherrygranger1
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/ 2

Git Cheat Sheet - Common Commands & Usage

git init
Initialize a new Git repository.
git clone <url>
Copy a remote repo to your computer.
git status
Check which files are staged/unstaged/untracked.
git add <file>
Stage a specific file for commit.
git add .
Stage all files for commit.
git commit -m "msg"
Commit staged changes with a message.
git log
View commit history.
git diff
View changes not yet staged.
git diff --staged
View staged changes.
git branch
List all branches.
git branch <name>
Create a new branch.
git checkout <name>
Switch to another branch.
git checkout -b <name>
Create and switch to a new branch.
git merge <branch>
Merge a branch into the current branch.
git pull
Fetch and merge changes from remote.
git push
Upload commits to remote.
git remote -v
List remote repositories.
git reset HEAD <file>
Unstage a file.
git reset --hard <commit>
Reset to a specific commit.
git stash
Temporarily save uncommitted changes.
git stash pop
Reapply the last stashed changes.

You might also like