Things have changed quite a bit since this answer. There is now a path to do exactly what OP is requesting via fine grained Personal Access Tokens. The fine grained permission ability is (currently) in beta, but allows you to generate a token with least privilege, and tie it to a specific repository.
You can then use GitHub HTTP authentication (instead of SSH) to be able to push commits.
- Generate a personal access token in GitHub user settings (
Settings → Developer settings → Personal access tokens → Fine Grained Tokens (beta) → Generate new token*
)
- Be sure to grant Read / Write to
Code and Commit Statuses
- Add this token to your
.git/config
like so:
[remote "origin"]
url = https://username:[email protected]/username/repo.git