Term used in version control systems that means combining several commits into one. Most often seen with git.
Questions tagged [squash]
286 questions
5
votes
3 answers
Should I squash small, development commits into bigger ones?
There are (too) many questions regarding how to squash commits for git and other DVCS, such as:
Squash my last X commits together using Git
How to squash all git commits into one?
Joining various commits in one without merging
Is there a way to…

Petr
- 62,528
- 13
- 153
- 317
5
votes
2 answers
git, squashing commits on the fly
I have a local git repo, one remote repo.
I made 5 commits to local repo since last pull from remote.
Now I need to push to remote. And I need to squash my last 5 commits.
I can do it by git rebase -i HEAD~5
But it's not good. I don't want to change…

Victor Mezrin
- 2,797
- 2
- 32
- 48
4
votes
3 answers
Accept default git commit message after a squashed merge
I would like to do the following in a script:
git merge --squash someBranch
git push
The problem is that the merge does not do a commit. So before the push I have to commit. The default commit message created by this merge is sufficient. So my…

Lars Bilke
- 4,940
- 6
- 45
- 63
4
votes
2 answers
Does git merge --squash cause headaches with cross branch merges
I'm working in a team which is growing and making use of git. We are generally working in our own branches.
I pulled some changes from another workers repository. His changes eventually were added to and merged into a master branch with a squash…

Jeremy French
- 11,707
- 6
- 46
- 71
4
votes
1 answer
Git rebase squash commits by hash
I have a branch with around 10 commits. 3 of these are merge commits merging master to my branch and adding ~500 commits in between each time. Is there a way to squash commits that were made on the current branch in one? my history looks something…

ayushgp
- 4,891
- 8
- 40
- 75
4
votes
2 answers
How does squashing, rebasing, reset --soft affect github contributions page?
For some projects I do or work on sometimes it is usually best that we squash/rebase all changes into a single commit. However, I was wondering how this affects the contributions page on github.
For example, if I spent 2 months pushing changes to a…

riace
- 111
- 1
- 9
4
votes
1 answer
git rebase / squash - why do I need to resolve conflicts again?
I really tried looking through similar topics but I just can't seem to get a grip of the concept.
I forked a repo, made some changes. Overtime, I also used git fetch upstream and git merge upstream/ a few times. Some time, there are…

some user
- 876
- 1
- 12
- 26
4
votes
1 answer
Does 'git squash' (after pushing) rewrite the history?
I'm working on a separate branch for a feature.
Now I want this feature in my main branch, but just having all the commits squashed to a single one (with a recap into the commit message).
The thing is that I already pushed the branch to remote.
So…

Kamafeather
- 8,663
- 14
- 69
- 99
4
votes
1 answer
git rebase: "Could not apply (hash)." I'm lost
I've been asked to "rebase and squash (my) commits into a single commit?" for a pull request https://github.com/samtools/htsjdk/pull/34#issuecomment-45226559
It's the first time I'm doing this and I think I only do wrong things. I'm currently…

Pierre
- 34,472
- 31
- 113
- 192
4
votes
1 answer
JGit: How to squash commits
Any suggestions on how to use RebaseCommand, MergeCommand or any other command in JGit to squash commits? I cannot find many examples and the documentation is not very helpful.
A simple example
I want to squash the following…

modulitos
- 14,737
- 16
- 67
- 110
4
votes
3 answers
Why does 'Git rebase' squash commits into a previous commit, instead of the following commit?
When I squash commits in a branch (using git rebase -i), I'm always annoyed that the squashed commit is combined with the older commit instead of the newer commit.
I don't understand why it was designed this way. When I commit a work in progress…

jmbeck
- 938
- 2
- 11
- 21
4
votes
3 answers
What's the difference between git merge --no-ff and git merge --squash
I've working with a small team using the 'merge workflow' and we recently switched over to the 'rebase workflow' as per Sandofsky's article.
our current workflow:
git checkout master, git pull origin master
git checkout -b feature_branch, do…

Nikola
- 817
- 13
- 19
4
votes
2 answers
git squash and keep the last commit exactly
I am getting merge conflicts when squashing commits and the last commit ends up DIFFERENT than it was before the squash. Why does the final result change when i run
git rebase -i someothercommit
then squash undesired intermediate commits leaving…

swinman
- 391
- 3
- 10
3
votes
1 answer
What happens if I use git pull (merge) and squash my commit into master?
I'm unsure if this strategy is causing us more issues than it's worth. Let's use this as an example (pulled from git docs).
A---B---C---D---E origin/master
\
X---Y--- feature/branch
I've created a feature/branch of…

Travis Peterson
- 373
- 3
- 15
3
votes
1 answer
How to squash commits that contain a merge commit
Is there a way to squash commits that have a merge commit? I am able to squash when there is not any merge commits but I don't know how to do it when there is one.
Like these two commits.

Burak Akyalçın
- 302
- 5
- 26