git branch |
Lists / creates and deletes branches |
git branch feature |
Creates the feature branch |
git branch -d feature |
Deletes the feature branch |
git switch |
Switches between branches |
git switch feature |
Switches to the feature branch |
git checkout |
Switches between branches |
git checkout -b feature |
Creates and switches to the feature branch |
git merge |
Merges branches |
git merge feature |
Merges the feature branch into the current branch |
git merge --abort |
Aborts a merge |
git merge --squash |
Squaches commits on branch into a single commit and merge |
git stash |
Stashes changes for later use |
git stash -m "stashing message" |
Stashes changes and includes a message |
git stash list |
Shows stored stashes |
git stash apply |
Applies the latest stash |
git stash apply stash@{n} |
Applies a specific stash |
git stash pop |
Applies the latest stash and removes it from stash list |
git stash pop stash@{n} |
Applies a specific stash and removes it from stash list |
git cherry-pick <commithash> |
Applies changes from <commithash> |
git rebase |
Different way of integrating changes from two branches |