Tony
Tony

Reputation: 473

Bitbucket squash commits on a branch

I have a load of commits, on a bitbucket branch where I was experimenting on the code. I want to squash all those into just one commit, without squashing all the other commits. Does this call for a rebase.

Bit confused on what a rebase is.

Upvotes: 1

Views: 1665

Answers (1)

rnwed_user
rnwed_user

Reputation: 1660

yep you will get a console to edit the commits: like this:

git rebase -i qa then press keyboard 'i' to edit

you will see like this:

pick etc1
pick etc2
pick etc2

replace the word pick with 'f' and press esc y :wq

pick etc1 //this commit will the one commit
**f** etc2
**f** etc2

and press this command

git push origin +head

Upvotes: 1

Related Questions