Git Cheat Sheet
Setup
Set your name to be used as the commit author
Set your email to be used as the commit author
Creating Repositories
Initialize a new Git repository
Clone an existing repository
Making Changes
Check the status of your repository
Add a file to the staging area
Add all modified and new files to the staging area
Commit changes with a message
Remove a file from the staging area
Viewing History
View the commit history
View changes that have not been staged
View changes that have been staged
Working with Remotes
Add a remote repository
Push changes to a remote repository
Pull changes from a remote repository
Branching
List all branches
Create a new branch
Delete a branch
Switch to a branch
Merging
Merge a branch into the current branch
Stashing Changes
Stash changes
View a list of stashes
Apply the latest stash
Discard the latest stash
Tagging
Create a new tag
Create a new tag with a message
Delete a tag
Push tags to the remote repository
Reverting Changes
Revert the last commit
Revert a specific commit
Resetting
Reset the staging area to the last commit
Reset the staging area and working directory to the last commit
Reset the staging area and working directory to a specific commit
Aliases
Create aliases for commonly used commands
My Services
💼 Take a look at my service catalog and find out how we can make your technological life better. Whether it’s increasing the efficiency of your IT infrastructure, advancing your career, or expanding your technological horizons — I’m here to help you achieve your goals. From DevOps transformations to building gaming computers — let’s make your technology unparalleled!
Refill the Author’s Coffee Supplies
💖 PayPal
🏆 Patreon
💎 GitHub
🥤 BuyMeaCoffee
🍪 Ko-fi