If another branch dev2
has been pushed by someone else, that way to get it locally is (in:
git checkout master
git branch -d dev2
git fetch
git checkout -b dev2 origin/dev2
The second command delete the 'dev2
' branch you did, because you don't have to merge anything yet: you just have to fetch and reference dev2
.
Later, you can merge dev2
to dev
, and resolve merge conflict then.
Note: this won't work if you already push (as in git push --force dev2
) back to the upstream repo.