Use Case: Go back and make a change on an old branch
Generic instructions to make a change on OldBranch (e.g. FND-129) and make it look like it happened on LatestBranch (e.g. FND-140)
- Make OldBranch the current branch
- Make and commit the change on OldBranch. OldBranch and NewBranch will now be on separate commit paths.
Next. we want to make it look like the new commit just made on OldBranch is on the SAME commit path as and happende after NewBranch
- Right-click on the NewBranch
Select the rebase option from the dropdown
- Examine the pop-up to make sure it does what you want
- Click OK. It looks like the figure below. Note that there are a lot of subsequent changes that need to be pushed to origin on 129 which was last touched 10 days prior.
Here is an example of this being done in real life, doing real work. I had completed work on a branch called FND-129 corresponding to a JIRA of the same name. I made quite a few commits after that and I need to go back and make some changes on the FND-129 branch. This is how I proceeded: