Skip to content

Commit 33a5448

Browse files
committed
Add squash commits command
1 parent 99cbb81 commit 33a5448

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

README.md

+9
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,15 @@ git push -f origin master
107107
(Use the `-f` only when first rebase)
108108

109109

110+
## Squashing commits
111+
Squashing previous 'n'commits into one new commit
112+
```bash
113+
// Assuming you want to squash previous 2 commits
114+
// HEAD~n specifies number of commits to squash
115+
git reset --soft HEAD~2 && git commit -m 'New commit message here'
116+
```
117+
118+
110119
## Delete Changes
111120
Discards all changes made in working directory
112121
```bash

0 commit comments

Comments
 (0)