What did I miss or how can I create a pull request with only the changes done in the topic branch and not everything I have done in the master branch?
When you do a pull request, it will ask for the upstream project to pull the whole branch contents & do a diff against upstream branch. This includes your commits in the current branch, but also all commits that are in the history in the branch.
So, if history on upstream is A -> B -> C, you clone this, then create a feature D you push in master in your own repository, then create a branch from D and commit E (you'll get A -> B -> C -> D -> E in this branch), the pull request will make a diff between upstream history (A -> B -> C) and your current commit log (A -> B -> C -> D -> E), and not only the commits you exclusively made in your branch.
What you want to do is clone the upstream repository and commit your new feature by creating a branch from upstream's master branch, not from your master branch.
Thank you for your quick response.
I had to lookup what an upstream repository is, but I think I found out how it works.
I did the following
$ git remote add upstream
https://github.com/bitcoin/bitcoin$ git fetch upstream
getting the last changes from upstream to be up to date
$ git checkout master
$ git merge upstream/master
then I checked out the upstream/master
$ git checkout upstream/master
$ git checkout -b <topic_branch>
and added my changes again.
Unfortunately the last update killed my changes as the feature I wanted to add relies on a feature which was removed 2 days ago....
So I cannot continue to check if creating a pull request would work the way I did now.
Maybe you can tell me if I'm on the right track with my steps above so I can do it correctly when I have another change I want to contribute?
What would be the correct next steps to create a pull request?
$ git commit
$ git push -u upstream/master <topic_branch>
Would I see then the upstream branch in my github repository to be able to create the pull request from there?
I think I need to do some experimenting on a github test project as well to see how everything works.
Edit: did not see your last edit before posting my comment.
But it looks like I found the correct way how to do it. I think I just did also some unnecessary steps.
I will do some tests on a test project to make sure I understood everything correctly.
Thank you so much!