Why does a combined pull request on GitHub create a duplicate commit?

At my company, we ask developers to paste commits on feature branches before merging with develop . After the distribution, the developer pushes GitHub and writes to GitHub to create a transfer request.

When the stretch request merges, we finish looking at the two commits in the history of the develop branch:

  • Commit message "merged pull request"
  • Single compressed commit from feature branch

Why is this happening? And how can we avoid this? I read a similar Q & A to avoid "adene adrolirovaniya" , but my goal is to use the GitHub interface to create, track and discuss traction requests.

+5
source share
1 answer

The end you see is a fixation of the merger; they are usually automatically created using git anytime you do a cross-merge, but you can also force it to always be created. And that is exactly what GitHub does when you use the merge button.

If you do not want the merge commands, then you need to hang the cherry on the master instead of using the merge button. There is no way to do this inside the GitHub web interface.

Edit: GitHub now added squash and merge and rebase and merge in its web interface:

enter image description here

+7
source

Source: https://habr.com/ru/post/1246653/


All Articles