I am currently working on a project with multiple others. The problem is that we created a fork of an existed project and need to squash all our commits from after the forking process to a single commit for a pull-request on Bitbucket.
Is there any way (preferably using SourceTree, otherwise terminal) to squash already pushed commits to a single commit, such that the history within Bitbucket of all the commits are also only that one commit plus the commits which were already there before we forked the project?
Take as example just a simple project with a few files in only a master
branch.
git rebase
!Bitbucket use the Git software.
alex said it already in his post: Use the
git rebase -i ourbranchname
command!
Use these commands in the terminal, command prompt or in your cmd:
git rebase -i yourbranchname
pick
" to "fixup
" but one commit must have "pick
"!git push -f origin yourbranchname
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With