Questions tagged [squash]

Term used in version control systems that means combining several commits into one. Most often seen with git.

See Git - Tools - Rewriting History: squashing.

286 questions
7
votes
3 answers

How to delete django migrations after squashing them?

Django documentation says we could delete migrations after squashing them: You should commit this migration but leave the old ones in place; the new migration will be used for new installs. Once you are sure all instances of the code base have…
mehmet
  • 7,720
  • 5
  • 42
  • 48
7
votes
1 answer

Git squash and merge

Could anyone please tell me what the difference between these two commands: git merge --squash and git merge --no-ff
Green Ho
  • 881
  • 3
  • 14
  • 27
6
votes
2 answers

Branches out of sync after squash merge

I have a develop branch with multiple commits. This branch shall be merged into the master branch. I also would like the master branches commit history to be as clean as possible, so I want to only have one entry for the merge. Thus I do the…
Boris
  • 8,551
  • 25
  • 67
  • 120
6
votes
2 answers

How to squash a merge commit with a normal commit?

commit b0e5db36ed68d4562275adeb08001b1316a4da52 Merge: ea38baa 8220bb1 commit ea38baa3f46a48722987b8dd3892d2b8d81c4d1a In this case how do I squash these two commits I am using git rebase -i HEAD~2 but this doesn't work as it removes the Merge…
Soumya Mohapatra
  • 85
  • 1
  • 1
  • 5
6
votes
1 answer

Git: Squashing consecutive commits that are not the most recent commits, and do not start at the root

I have reviewed several related questions about squashing the most recent commits and squashing a commit at the root, but neither will help me squash non-recent commits that are not at the root. Here is my starting…
modulitos
  • 14,737
  • 16
  • 67
  • 110
6
votes
2 answers

How to git merge squash in Eclipse

Sometimes I need to merge squash from Eclipse. I know I can do it in command line, but it will be really useful to have graphic option integrated in Eclipse. Do you know how to do it?
Kritana
  • 2,236
  • 1
  • 14
  • 7
6
votes
1 answer

git merge with --no-ff and --squash

I am using the Git Flow way of managing branches in my repository. Thus the sequence of commands I should use would be as follows: git checkout mybranch git pull --rebase origin develop git checkout develop git merge --no-ff mybranch However, there…
bguiz
  • 27,371
  • 47
  • 154
  • 243
6
votes
1 answer

How can I squash commits between A and K into one commit Z

If I have a commit history like this: A-B-C-------G-H-J-K (master) \ / D-E-F how can I squash commits between A and K into one commit Z: A-Z-K (master) ?
timotei
  • 63
  • 1
  • 5
5
votes
2 answers

Are commits preserved by GitLab even after the branch is deleted after MR get merged

In our development using GitLab we usually squash commits from feature branches when they are merged in main branch (we use rebase strategy instead of merge if it matters). But if the commits from feature branch are squashed to a single commit…
uranix
  • 657
  • 1
  • 5
  • 23
5
votes
1 answer

GitFlow, squashing and merging issues

I'm using GitFlow in my git repository, so I have a master, develop and (temporary) release branch. Workflow I create a new branch from develop (e.g. fix/fix-the-bug) I squash my fix into meaningful commits I merge my fix/fix-the-bug branch into…
GlennM
  • 300
  • 1
  • 14
5
votes
1 answer

Squash Commits of a branch after merging in GIT

Hi I have a branch stable which contains merged commits of other branches. The structure is as follows: Commit History: Commit 1 - Branch 1 commit 1 ------------- Hash Code 1 Commit 2 - Branch 2 commit 1 ------------- Hash Code 2 Commit 3 - Branch 2…
Akshay
  • 153
  • 3
  • 14
5
votes
1 answer

Git: How to convert an existing `merge` to a `merge --squash`?

I performed multiple merge commits but they should have been merge --squash instead. The conflict resolution took more than a day so I can't afford to redo the merging by hand. Is there a way to convert the merge to merge --squash ?
Julien__
  • 1,962
  • 1
  • 15
  • 25
5
votes
1 answer

How is "author" determined for a git commit when rebasing and squashing?

I rebased a coworkers branch that had 2 commits and squashed the second commit into the first one. It preserved the original author (i.e. not me). Suppose I want to fix one line of code, so I reverse a hunk and make a new commit. At this point, I'm…
Triynko
  • 18,766
  • 21
  • 107
  • 173
5
votes
1 answer

How do I make a copy of a branch for testing rebase?

I've done this before by creating a clone and doing the rebase in the clone, but I suspect I could do it safely on a separate branch. I have a feature branch feat-x with about 25 commits on it. I'd like to (safely) squash several of these…
bstpierre
  • 30,042
  • 15
  • 70
  • 103
5
votes
1 answer

Git rebase -i does nothing

I'm having some trouble with git rebase -i not working as I expect from reading various pieces of online documentation and tutorials. I'm trying to squash my last four commits into one. Imagine a branch dev with remote origin/dev and commits A -> B…
Richiban
  • 5,569
  • 3
  • 30
  • 42