I have a situation where the client has his git repository setup as a public repository. The work that I do, I need to submit as pull request to his repository.
He can then goto github repository and see those pull requests sent by me and accept the pull request. So that the given changes done by me get submitted to his repository.
How can this be accomplished in git?
I have tried cloning his repository on my machine and then when I do git push it does not work. How can I just push my changes to his repository so that he can just pull it from his end?
Public repository doesn’t mean everyone has push access to the repository – only select users – and sounds like you’re not one of those.
What you need to do to use the “pull request” style of github workflow is to fork the clients repository in github. You then work by pushing your changes to your fork of the repo in github. When you have something ready for the client you go to the web page for his repository to file a pull request. (You may be able to do it from the page of your fork too, can’t remember).
They will then accept the pull request (or not) and your changes will be copied over into the original repo.
You can find a good overview of this workflow (with images) here.