Git – Push with custom ssh key occasionally

We have a deployed site where we use deploy key (read-only) to pull changes. But in maintenance mode the site modify itself, so we want to push back those changes. Is there any way to push back changes through ssh without storing the key itself on the server? I am looking for something like git push -ssh-key="ssh-rsa ..."

I would like to solve the issue with default commands if its possible.

  • GIT SSH public key error
  • Capistrano deploy with bitbucket - Permission denied (publickey)
  • Gitlab can't clone repository even though ssh works
  • GitLab SSH requests password and ignoring SSH Keys
  • SSH multiple BitBucket accounts + 2 step verification recovery
  • git: can pull but can't push
  • Git repositories on shared hosting with ssh access - multiple users / one ssh account
  • Phabricator hosted Git repository setup issues
  • One Solution collect form web for “Git – Push with custom ssh key occasionally”

    IF you are using ssh keys you mush “exchange” keys and the server has to validate it using your key.

    What you can do instead is to set a trusted certificate on the server (signed certificate ) and then use it instead of the ssh key.

    A very detailed answer how to it can be found here.
    configure Git to accept a particular self-signed server certificate for a particular https remote

    Git Baby is a git and github fan, let's start git clone.