Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

pull request to upstream repo contains commits previously fetched/merged from upstream repo?

Tags:

github

I'm new to git and github, so apologies for the newbie question. I've searched the documentation and haven't been able to tell what I'm doing wrong, or even IF I'm doing it wrong...

I've forked a repo on github, cloned it locally, made some changes in a couple of branches, committed those changes locally, and pushed them to my forked repo on github. While I've been working on that stuff, a variety of commits were made to the upstream repo I forked from. I'm not sure if this is the right thing to do, but I fetched and merged those upstream changes, then pushed again to my fork.

Now, I want to send a pull request to the upstream repo. But when I start to do that, github lists all the commits that would be part of the pull request, and it includes all those changes that were already made to the upstream repo that I fetched and merged already.

That doesn't seem right. What do I need to do here?

like image 551
Andy Dennie Avatar asked Oct 08 '22 02:10

Andy Dennie


1 Answers

This is OK as you have pushed these commits to your forked repo and hence they logically belong to your pull request.

When the pull request is merged by the upstream repo's owner, Git will detect that it already "contains" some of the commits and will only merge in your changes.

Just create your pull request and you are fine.

like image 91
cfedermann Avatar answered Oct 12 '22 12:10

cfedermann