We use git and have a master branch and developer branches. I need to add a new feature and then rebase the commits to master, then push master to CI server.
The problem
You need to force the push as you have moved the commits further down the line git is expecting you to add commits to the tip of the branch. git push -f origin myNewFeature
will fix your problem.
Tip: Above is a legitimate usage of force pushing. Never ever rewrite the history on a publicly accessible repository or a lot of people will hate you.