U
U
user_of_toster2021-04-19 05:59:58
git
user_of_toster, 2021-04-19 05:59:58

Do I understand the sequence of work correctly?

There is a Main branch. The Feature branch is created. Development is underway, two commits appear in both branches. Then, when the Feature is finished, the Feature developer creates a pull request on the github with a request to review the code and make a merge.

Question - should a Feature developer do the following before a pull request?

git checkout Feature
git merge Main


Or is it enough for a team leader to do
git checkout Main
git merge Feature
git branch -d Feature // удаляется ли ветка или оставляется как есть?


Or merge becomes both there and there?
git checkout Feature
git merge Main
git checkout Main
git merge Feature
git branch -d Feature // удаляется ли ветка или оставляется как есть?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey Kuznetsov, 2021-04-19
@user_of_toster

There is no command line on Github itself, they will view your Pull Request through the graphical interface and if there are no complaints and there are no conflicts, then they will merge with main by pressing the button.
If there are conflicts, then you yourself must resolve them locally and update the request.

git fetch # забрать все обновления с гитхаба
git checkout feature # переключиться на свою ветку если ещё не на ней
git rebase main # перестроить свою ветку поверх актуальной main
# скорее всего rebase будет останавливаться при конфликтах 
# и надо будет разрешать конфликты в файлах
# потом снова индексировать изменившиеся файлы (git add)
# коммитить (git commit)
git push -f # обновлённую ветку принудительно отправить на сервер

After the merge, the branch is usually deleted on github.
Locally, you can also delete it yourself.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question