Rebase your local code with the feature branches and push those branches to remote.

A--B--C------F--G  (Feature Branch A)
       \    
        D--E  (Feature Branch B)

Now we need to rebase Feature Branch B with Feature Branch-A like below,

A--B--C------F--G  (Feature Branch A)
       \        \
        ---------F--G--D--E  (Feature Branch B)

please follow the below steps to rebase and push.

  • Clone the repository with a respective branch(Feature Branch B)
$ git clone <git_url>  -b feature/branch-B
  • Check the log and make sure those commits are on the right track
$ git log
  • Check out the feature branch – A locally
$ git checkout feature/branch-A
  • Check the log and make sure those feature/branch-A are on the right track
$ git log
  • Change the branch to feature/branch-B locally
$ git checkout feature/branch-B
  • Now rebase your local feature/branch-B with feature/branch-A locally
$  git rebase feature/branch-A
  • If it merges locally without any conflict we should be good to push the changes to the remote branch
 $ git push --force origin feature/branch-B

Categorized in:

Tagged in: