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
Command | Description |
---|
git init | Initialize a local Git repository |
git clone | Create a local copy of a remote repository |
git add | Add a file to the staging area |
git commit -m "message" | Commit the staged changes with a message |
git push | Push the committed changes to the remote repository |
git pull | Pull the latest changes from the remote repository |
git status | Check the status of the repository |
Branching
Command | Description |
---|
git branch | List 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 pull | Ziehen der letzten Änderungen aus dem entfernten Repository |
git status | Status des Repositorys prüfen |
Advanced Commands
Command | Description |
---|
git stash | Stash the changes in a dirty working directory |
git log | View the commit history |
git diff | View 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 |