In order to be accredited at the Contributors page on GitHub and in the app, your commits must be linked to your GitHub account. Simply create the commits with an email address that is assigned to your GitHub account (or add the email address to GitHub). You can verify that it worked by checking if the commit icon above shows your profile icon.
If you do not care about the contributors page, please say so in your PR :)
You can change the author of the most recent commit by running something like git commit --amend --author="John Doe <john@doe.org>"
. Changing something like that requires to force-push the changes (git push --force
). To change multiple commits, have a look at interactive rebase.