0

I have parent branch 'development' from which a child branch is cloned 'child_dev'.

Some commits have been done in 'development' after 'child_dev' was created, which is not reflected in the child branch.

I tried :

git checkout child_dev
git fetch origin
git rebase origin/development

This brought the new changes to the local child branch 'child_dev'. I made some changes to few other files and tried to push it using:

git push origin child_dev

but it showed error - (non-fast-forward)

Can anyone help me?

Maroun
  • 94,125
  • 30
  • 188
  • 241
Sneha S
  • 15
  • 4
  • 2
    Sure.... rebasing _rewrites_ history. If you try to push that branch into the remote, git won't like it (to git, it's like the branch diverged)... but that's not a problem. Just force-push (assuming you know what you are doing and you are not busting other people's changes on that branch). – eftshift0 May 06 '21 at 14:25
  • Worth mentioning: Git branches never have parent/child relationships. Git *commits* do, and for the situation you're talking about, the lack of *branch* parent/child relationships is not important. But for talking with other humans, and thinking about what you are doing, it's best to drop this parent/child idea with respect to *branch names* as it will just get you into trouble later. – torek May 07 '21 at 01:12

0 Answers0