Reputation: 61
I have 2 branches with commits.
Branch B looks something like:
This happened because of a wrong rebase..
Before I make a merge request for Branch B I would like to fix it and remove all commits from Branch A.
What is the best way of doing this?
Upvotes: 1
Views: 157
Reputation: 980
You can use git rebase -i HEAD~n
, Here n
is the number of commit you want see in the bash and change them.
Steps(In your case) :
git rebase -i HEAD~7
pick
word with drop
for commit's you want to delete from branch Bgit push --force-with-lease <remote> branch B
OR git push -f <remote> branch B
it will push your lastest changes (without branch A's commit)Upvotes: 2