I have a friend who has a repository in his GitHub account. I want to contribute (pull/push) to the master branch (the only branch) on that repo directly.
The right way would be to fork his repository, do your work and then create a pull request. Then he could review it and decide to merge it into his work. Here's a good description: https://guides.github.com/introduction/flow/index.html