On Tue, 2017-05-16 at 02:16 -0700, Gary Gregory wrote:
> On Tue, May 16, 2017 at 2:12 AM, Gary Gregory <[email protected]
> >
> 

...

> > I went through the "Hard mode: Squash commits" option from
> > https://makandracards.com/makandra/527-squash-several-git-commits-i
> > nto-a-
> > single-commit but that failed since (as the post mentions) I had
> > merged
> > from trunk since I created the branch. I will use option 1.
> > 
> > We are going to need a better wiki page on this one...
> > 

Gary,

There is a simpler variation of option 2. If all you want is to squash
the last commit you can do 

---
git reset HEAD~1
git add .
git commit --amend
---

Reset HEAD back commit while keeping the changes; add those changes;
commit those changes by amending the last commit.

Same process for the last n commits (say n = 3)
---
git reset HEAD~3
git add .
git commit --amend
---

Oleg


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to