I would like to do a pull request, but found out that master is ahead of feature branch.
So i do
git checkout master
git pull
git git checkout feature
git rebase origin/master
and boom, i get conflict message ( expected ) but rebase will also overwrite every single change i made in my feature branch and overwrites them with months old code from feature branch... ( code that comes with rebase is not in any branch afaik ) with commit message from start of the feature branch.
rebase will also delete all of my new classes, which can't possibly conflict with master. Both local and remote master and feature are uptodate, and show expected code. But as soon as i do rebase.
So rebase wants me to do all 82 commits and conflicts instead of the latest commit ?
I simply want to apply my latest code and commit to master, with PR. I dont want useless code from months ago when somebody else started this feature and forgot to rebase....
Is this possible ?
Checkout your feature branch and pull from master
into your feature
branch. Resolve any conflicts if you have and then merge it to master
. This way you will not loose any commits from your feature branch
.
git checkout feature-branch
git pull origin master
#resolve any conflicts if you get
git commit
git push
#pull request should be updated with your master branch contents now