git
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revision | |||
| git [2026/06/14 09:08] – [Merge] jhagstrand | git [2026/06/14 09:18] (current) – [Squash Merge] jhagstrand | ||
|---|---|---|---|
| Line 222: | Line 222: | ||
| ==== Squash Merge ==== | ==== Squash Merge ==== | ||
| - | | + | The --squash option, the merge command does not really do a merge. |
| - | git merge --squash | + | |
| + | This is one of the ways to collapse a developer' | ||
| + | |||
| + | # Make sure you're on the branch you want to merge into | ||
| + | git checkout master | ||
| + | |||
| + | | ||
| + | # this stages all the file changes | ||
| + | git merge --squash | ||
| + | |||
| + | # ask for status now and you'll see all the changes ready for commit | ||
| + | git status | ||
| | | ||
| # now commit | # now commit | ||
| - | git commit -m "feat: add animate | + | git commit -m "feat: add feature |
| | | ||
| # delete the feature branch | # delete the feature branch | ||
| - | git branch -D animate | + | git branch -D feature |
| | | ||
| - | # for fun do a log all between these commands to what's going on | + | # for fun do a log all between these commands to see what's going on |
| git log --all --oneline -15 --graph --decorate | git log --all --oneline -15 --graph --decorate | ||
git.txt · Last modified: 2026/06/14 09:18 by jhagstrand