menu_book Course Curriculum (Git Version Control) expand_more
Repository Foundations
Branches & Merging
History Editing
Remote Collaboration
Selective Workflows
Objects & Internals
Configuration & Hooks
Squash commits
Learn Squash commits in Git Version Control with a dedicated explanation, a topic-specific example, edge guidance, and a mastery check.
12 min read
•
Intermediate
git-022.sh
shell
rm -rf /tmp/sx-git-22; git init -q /tmp/sx-git-22; cd /tmp/sx-git-22; git config user.name Syntaxis; git config user.email lesson@example.test; printf "base\n" > app.txt; git add app.txt; git commit -qm base; echo one >> app.txt; git commit -am one -q; echo two >> app.txt; git commit -am two -q; git reset --soft HEAD~2; git commit -m "squashed work"
What to watch
Content source & attribution
Original Syntaxis Content · Original Syntaxis Content