После создания pull-реквеста — Bitbucket сообщает о конфликте:
Локально — переключаемся на бранч, в который создавали pull-реквест:
d:***plugins>git checkout develop Branch develop set up to track remote branch develop from origin. Switched to a new branch 'develop'
Проверяем:
d:***plugins>git branch NG-5071-add-propertygroup-to-csproj-file * develop
NG-5071-add-propertygroup-to-csproj-file тут — это бранч, из которого создавался запрос.
Обновляем в данные в develop:
d:***plugins>git pull origin develop Password for 'https://[email protected]': From https://bitbucket.org/projectname/plugins * branch develop -> FETCH_HEAD Already up-to-date.
Переключаемся на исходный бранч, из которого хотим внести изменения в develop:
d:***plugins>git checkout NG-5071-add-propertygroup-to-csproj-file Switched to branch 'NG-5071-add-propertygroup-to-csproj-file' Your branch is up-to-date with 'origin/NG-5071-add-propertygroup-to-csproj-file'.
Обновляем его тоже:
d:***plugins>git pull origin NG-5071-add-propertygroup-to-csproj-file Password for 'https://[email protected]': From https://bitbucket.org/projectname/plugins * branch NG-5071-add-propertygroup-to-csproj-file -> FETCH_HEAD Already up-to-date.
Пробуем выполнить merge — и получаем конфликт:
d:***plugins>git merge develop ... Auto-merging Plugins/EventContext_Api/EventContext_Api.csproj CONFLICT (content): Merge conflict in Plugins/EventContext_Api/EventContext_Api.csproj ... Automatic merge failed; fix conflicts and then commit the result.
Открываем для редактирования файл с конфликтом:
d:***plugins>subl Plugins/EventContext_Api/EventContext_Api.csproj
Рассмотрим:
<<<<<<< HEAD
<PropertyGroup>
<BuildType>MAIN</BuildType>
</PropertyGroup>
</Project>
=======
</Project>
>>>>>>> develop
<<<<<<< HEAD — начало текста с изменениями в локальном бранче;
======= — окончание этих изменений;
>>>>>>> develop — окончание изменений в бранче, в который выполняем merge (develop).
Редактируем, убираем конфликты, например:
...
</ItemGroup>
<PropertyGroup>
<BuildType>MAIN</BuildType>
</PropertyGroup>
</Project>
Сохраняем файл, добавляем и комитим:
d:***plugins>git status
...
Unmerged paths:
(use "git add <file>..." to mark resolution)
both modified: Plugins/EventContext_Api/EventContext_Api.csproj
d:***plugins>git add Plugins/EventContext_Api/EventContext_Api.csproj
d:***plugins>git commit -m "resolving conflicts" [NG-5071-add-propertygroup-to-csproj-file d94edc0] resolving conflicts
Загружаем изменения в репозиторий:
d:***plugins>git push origin NG-5071-add-propertygroup-to-csproj-file ... Total 27 (delta 26), reused 0 (delta 0) remote: remote: View pull request for NG-5071-add-propertygroup-to-csproj-file => develop: remote: https://bitbucket.org/projectname/plugins/pull-request/1118?t=1 remote: To https://[email protected]/projectname/plugins.git 5d5ea90..d94edc0 NG-5071-add-propertygroup-to-csproj-file -> NG-5071-add-propertygroup-to-csproj-file
Обновляем страницу в Bitbucket — конфликт решён:







