Syncing & rebasing when behind
Scenario:
When your branch is seriously outdated, with submodules.
You want to finally push your changes to develop.
Switch to dev
git switch develop
Pull your most actoual dev
git pull
Sync submodules
git submodule update --recursive
Take your status :-)
git status
Go to your feature branch
git switch feat/XXX-NNNNNN
Rebase to your freshly pulled local develop
git rebase --interactive develop
Clean your conflicts and continue to the end
git rebase --continue
Your outdated remote branch is not as actual as your local, you can use -f to force overwrite with your HEAD.
Be precise here - you are overvriting remote feature branch.
git push -f origin HEAD:feat/XXX-NNNNNN
Now we are done :-)
General rules
This is general example without push
git checkout develop
git pull origin develop
git checkout feature-brach
git rebase develop