So I've just recently started using more of git functionality and I'm a bit lost.
I cloned the repo from master
branch.
Did some coding.
I git checkeout -b newbranch
then git commit
and git push origin newbranch
I did pull request in bitbucket but it was pointing to master
branch and I was told to point it to develop
branch so I did. Then I got:
So in my terminal i did git checkout develop
but when I tried to git pull
I got Already up to date
message. So if develop
branch is different than newbranch
and 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.
The conflicts you need to solve are between develop
and newbranch
.
The two main ways to fix this issue from your local repo are :
newbranch
on top of develop
# 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
develop
into newbranch
# 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