Skip to main content

Git - Cheat Sheet

Welcome to Git - Cheat Sheet! Here you'll find all the important Git commands, compact and clear. Whether you're a beginner or a pro, everything you need for the perfect overview is here. This way, you'll always have your repository under control!

Basic Commands​

CommandDescription
git initInitialize a local Git repository
git cloneCreate a local copy of a remote repository
git addAdd a file to the staging area
git commit -m "message"Commit the staged changes with a message
git pushPush the committed changes to the remote repository
git pullPull the latest changes from the remote repository
git statusCheck the status of the repository

Branching​

CommandDescription
git branchList all local branches
git branch <branch>Create a new branch
git checkout <branch>Switch to a different branch
git merge <branch>Merge a branch into the current branch
git branch -d <branch>Delete a branch
git pullZiehen der letzten Änderungen aus dem entfernten Repository
git statusStatus des Repositorys prüfen

Advanced Commands​

CommandDescription
git stashStash the changes in a dirty working directory
git logView the commit history
git diffView the changes between commits, commit and working tree, etc.
git reset <file>Unstage a file
git cherry-pick <commit>Apply the changes from a specific commit
git rebase <branch>Rebase the current branch onto another branch