Reputation: 473
New to git. I did a git pull on a 'commonDev' branch I would like to merge my feature branch to. However after doing git pull on 'commonDev' I got conflicts on files which were not even mine. I resolved them manually however I would like to start fresh now on the commonDev' branch as it is saying I will have to merge those files which I manually modified.
Can I delete the branch locally using git branch -D commonDev
and then checkout commonDev again so that I can merge my branch?
After reading thru other questions on SOF I see I should have used git pull --rebase
. But now I already did git pull
how do I safely delete the local or merge those files which are not mine?
Upvotes: 1
Views: 862
Reputation: 2685
From your local commonDev branch, you can git reset --hard origin/commonDev
to force your local commonDev branch to be the same as the remote commonDev branch. This will wipe-out any changes you have made to your local commonDev.
Then, I'd suggest checking out your feature branch, rebasing it, then merging it.
Upvotes: 1