So I've just recently started using more of git functionality and I'm a bit lost.
I cloned the repo from
masterbranch.Did some coding.
I
git checkeout -b newbranchthengit commitandgit push origin newbranchI did pull request in bitbucket but it was pointing to
masterbranch and I was told to point it todevelopbranch so I did. Then I got:
So in my terminal i did
git checkout developbut when I tried togit pullI gotAlready up to datemessage. So ifdevelopbranch is different thannewbranchand it's causing conflicts why I can't pull it? What don't I understand here?
I need to get the code from develop branch, resolve conflicts and than push it again and do pull request again.
CodePudding user response:
The conflicts you need to solve are between develop and newbranch.
The two main ways to fix this issue from your local repo are :
- rebase
newbranchon top ofdevelop
# from branch 'newbranch' :
git checkout newbranch
# rebase on top of 'develop' :
git rebase develop
# if you actually need to edit or drop commits along the way, you may use
# an interactive rebase :
git rebase -i develop
- merge
developintonewbranch
# from branch 'newbranch' :
git checkout newbranch
# merge 'develop' :
git merge develop
Choose whichever way is adapted to your workflow.
You will need to fix conflicts to complete either of these actions -- your remote says that there are some.
Once you are satisfied with your updated newbranch on your local repo, push it to your remote :
git push origin newbranch
# if you ran rebase, you will need to force push your branch :
git push --force-with-lease origin newbranch
