squash

Git squash all commits into a single commit

How do you squash your entire repository down to the first commit? I can rebase to the first commit, but that would leave me with 2 commits. Is there a way to reference the commit before the first one? ...

git rebase interactive: squash merge commits together

Hi, I wanted to have a simple solution to squash two merge commits together during an interactive rebase. My repository looks like: X --- Y --------- M1 -------- M2 (my-feature) / / / / / / a --- b --- c --- d --- e --- f (stable) That is, I have a my-feature branch that has ...

In git, what is the difference between merge --squash and rebase?

I'm new to git and I'm trying to understand the difference between a squash and a rebase. As I understand it you perform a squash when doing a rebase. ...

Remove/squash entries in a vertical hash

I have a grid that represents an X, Y matrix, stored as a hash here. Some points on the X Y matrix may have values (as type string), and some may not. A typical grid could look like this: {[9, 5]=>"Alaina", [10, 3]=>"Courtney", [11, 1]=>"Gladys", [8, 7]=>"Alford", [14, 11]=>"Lesley", [17, 2]=>"Lawson", [0, 5]=>"Katrine", [2, 1]=>"Tyra...

Massive git commit squashing

My company is in the middle of converting from CVS over to git. We've been on CVS for a long time, so there is a huge history. Too much to do by hand. Looking at the logs, there is a lot of squashing that could be done. A whole lot. What I would like to do is hook in a script that will compare two adjacent commits. If it returns true, t...

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 together. (I say "safely" because the first couple of times I squashed I didn't get it right -- bu...

How can I safely use git rebase when working on multiple computers?

I work on the same project on two different computers, desktop and laptop. Sometimes I need to transition between them while in the middle of some task/feature. So I want to make a commit on the laptop, and then transport (push/pull) it to the desktop and continue. Then, when the feature is complete I want to make a new commit and then ...

Reorganizing hunks into commits

Hi, I have made a major refactoring of some code, and in the process I have commited several times. This has not been pushed to any public repo yet. Before pushing, I would like now reorganize the commits into logical units. The problem is that I want not only to squash commits but to reorganze the hunks into other commits. Just to mak...