0

How to squash commits in git after they have been pushed?

I want to squash all commit id's which were pushed before a commit id (git rebase -i )

commit dc5aebdc5dc4a6b3fdcb95700d726de6ef489701

commit 83a1d881a28bcb894709ce538e08b3c0b4dd347c

commit 430269f03c57bdca9364f49ca2861652324a1593

commit 980269f03c57bdca9364f49ca2861652324a1534

For ex, In above log, I want to squash all commits which were pushed before dc5aebdc5dc4a6b3fdcb95700d726de6ef489701.

i.e. 83a1d881a28bcb894709ce538e08b3c0b4dd347c,430269f03c57bdca9364f49ca2861652324a1593 & 980269f03c57bdca9364f49ca2861652324a1534 into one commit.

Divins Mathew
  • 2,908
  • 4
  • 22
  • 34
Chandan
  • 601
  • 5
  • 3
  • This seems like an unusual request. Do you really want to squash _everything_ before a certain commit? Can you elaborate on what your particular situation is? – Tim Biegeleisen Jun 24 '17 at 08:35
  • I merged two different repo. In the new repo, I want to keep single commit for all commits from old repo i.e. indicating that till this commit, all were ported from old repo. – Chandan Jun 24 '17 at 08:47
  • [This answer](https://stackoverflow.com/questions/1657017/how-to-squash-all-git-commits-into-one) looks very relevant to your problem. – Tim Biegeleisen Jun 24 '17 at 08:49

0 Answers0