Raz Buchnik
Raz Buchnik

Reputation: 8411

What is the proper way to perform a pull request?

I have branch main and branch dev. They are on the same level. I then go to branch dev and create another branch from its base, called feature-a.

I commit 10 commits to feature-a and push to github. Then I go to github and create a pull request from the feature-a branch to the dev.

I review, I confirm and merged to dev.

Then I go to dev on local and pull the new changes to the dev.

Then I do the same process from dev to main.

Here the problem happens: the dev is behind the main branch, since the main has extra commit - of the merged dev, for example:

commitID1 (HEAD -> main, origin/main) Merge pull request #77 from GITHUB/dev
commitID2 (origin/dev, dev) Merge pull request #76 from GITHUB/feature-a

As you can see, the dev is now just behind main, instead of being on the same level as they had been in the start.

This doesn't let me see the flow of the merges and I wonder what is the best practice in here?

Upvotes: 0

Views: 351

Answers (1)

torek
torek

Reputation: 490068

This is all perfectly normal, and is how PRs on GitHub work.

This [output from git log --oneline] doesn't let me see the flow of the merges ...

To see that, use git log --oneline --graph, or a graphical viewer. See also Pretty Git branch graphs.

(There are alternative methods on GitHub where you don't actually do merges at all with your pull requests, but that's another topic entirely. You're already trying to follow an existing "do make merges" flow, where this is the result you should expect.)

Upvotes: 1

Related Questions