gitgithubgithub-actionsgit-branchconventional-commits

Will deleting specific commits from a branch affect the original branch it was created from?


I have a branch A that was created from another branch B. Some specific commits from branch B are also present in branch A. I’m considering deleting those commits from branch A, but I’m concerned about whether this will also delete them from branch B.

  1. If I delete commits from branch A, will those commits be deleted from branch B as well?
  2. Is there a way to make branch A fully independent from branch B so I can remove commits without affecting the original branch?

For context:


Solution

    1. No, Branch A is derived form Branch B and when you delete them it won't effect the "Parent Branch".

    2. You can use this code git rebase --onto [newParent] [oldParent] [branchToMove]

    I hope it helped you.