0

I've used git for a number of years but recently started using github to manage my repository. Has anyone else observed that pull requests once approved, do not appear to draw the merge lines when you look at it with an application such as gitkraken?

Here I just performed a pull request from staging to master, and after it merged, I don't see any sort of line that indicates that I merged from the latest staging to my master (the most recent commit)

here is a picture of the merge

The reason why I care is that I observed that later when I go to merge a second time from staging to master, I'm getting merge conflicts where it is forcing me to pick all the staging changes when there shouldn't be a merge conflict at all because master is simply an earlier form of staging.

I've done these pull requests for years on bitbucket, code commit and gitlab so I don't understand what is going on here- any tips?

Coherent
  • 1,933
  • 5
  • 24
  • 33
  • 2
    *How* was it merged? There are [multiple options](https://help.github.com/en/articles/configuring-pull-request-merges). – jonrsharpe May 03 '19 at 12:55
  • I created a pull request on github.com. I then approved my own PR with a squash, but I told it to keep the old branch (staging). – Coherent May 03 '19 at 12:59
  • 1
    The problem here is that you squashed the commits before merging. The squashed commit is merged to master, but you work on the old branch, i.e. on top of the unsquashed commits. when you want to merge the stage branch later on, the changes get applied *again*, but from other commits (or another squashed commit). Bam, conflict! Did you always do it this way, squashing and continue working on top of the unsquashed commits? – kowsky May 03 '19 at 13:30
  • Thanks! Maybe this is a quirk with github because I didn’t manually squash before trying to merge. I simply created a PR in github and selected the squash and merge option. The changes I have in the styled components is a new branch so that shouldn’t be affecting what I do between staging and master. – Coherent May 03 '19 at 13:44

1 Answers1

0

squash versus non squash merge It does appear like doing a non-squash merge fixes the problem. In this image you can see when I did a squash merge onto master, it shows up as a separate commit, while when I did a non-squash merge onto the branch "non-squash-merge" it shows up as you'd expect.

So I guess that means that I should do a squash merge from a feature branch to staging and a non-squash merge from staging to master. Weird!

Coherent
  • 1,933
  • 5
  • 24
  • 33