I just came across the problem that i wanted to push some changes in a repository which didn’t have commit rights, since it was only configured via deploy keys. It turned out that it’s possible to seperate the pull and push urls and their corresponding credentials.


git remote -v

origin git@github.com:User/forked.git (fetch)
origin git@github.com:User/forked.git (push)

you get a list of those.

git remote set-url --push origin https://ds@xyz.org/git/url.git

sets a different user/url for the current repository. Then you can just push with

git push