Getting started
Committing
Browsing the history
Undoing
Staging
Git diff
Merging
Ignoring files and folders
Working with remotes
Submodules
Aliases
Rebasing
Configuration
Branching
rev-list
Squashing
Cherry picking
Recovering
git clean
.gitattributes
.mailmap
Different workflows
Pulling
Hooks
Cloning repositories
Stashing
Subtrees
Renaming
Pushing
Internals
git-tfs
Empty directories in git
git-svn
Archive
Rewriting history with filter-branc
Migrating to git
Show
Resolving merge conflicts
Bundles
Display commit history graphically with gitk
Bisecting to find faulty commits
Blaming
Git revisions syntax
Worktrees
Git remote
Git large file storage
git patch
git statistics
git send-email
git gui clients
reflog - restoring commits not shown in git log
TortoiseGit
External merge and diff tools
Update object name in reference
Git branch name on Bash Ubuntu
Git client-side hooks
Git rerer
Change git repository name
git tagging
tidying up your local and remote repository
diff tree
Contributors

Squash Recent Commits Without Rebasing

suggest change

If you want to squash the previous x commits into a single one, you can use the following commands:

git reset --soft HEAD~x
git commit

Replacing x with the number of previous commits you want to be included in the squashed commit.

Mind that this will create a new commit, essentially forgetting information about the previous x commits including their author, message and date. You probably want to first copy-paste an existing commit message.

Feedback about page:

Feedback:
Optional: your email if you want me to get back to you:



Table Of Contents