publickey-authentication on git/stash for ssh not working

I’m trying to work with git/stash but I’m having a bit of a problem with the publickey-authentication. Here’s what happens:

hannibal is a user on the stash-server. hannibal has read/write-permission for one repository and an ssh-publickey added to his stash-account. I now create a repository via

  • Revert local Sourcetree repo to master
  • Install R package from Atlassian Stash
  • git stash, jenkins pipeline, No git jobs using repository
  • See treeview for branches in Atlassian Stash
  • Unstaged changes immediately after cloning in Eclipse
  • EGit and Stash with Eclipse - SSL hostname verification
  • git init

    and add & commit a test file test.
    Then I want to add the stash-repository as origin

    git remote add origin hannibal@stash:7999/path/to/repository.git

    which yields no further output. Now I try to push

    git push origin master

    which in turn asks me for the password (which is strange, since it should authenticate via publickey). I enter the password and the following error message displays on the screen:

    Could not chdir to home directory /home/hannibal: No such file or directory
    fatal: '7999/path/to/repository.git' does not appear to be a git repository
    fatal: The remote end hung up unexpectedly

    The URL is definitely correct, since it’s the one that stash gives me. Also ssh is enabled on the stash-server. What am I missing here?

  • meteorite error Cloning Mac
  • Uploading new files to a git repository directly through the github web application
  • How to programmatically determine whether the Git checkout is a tag and if so, what is the tag name
  • Syncing existing git with existing SVN repository
  • How to link to specific line number on git?
  • How to preserve the file permission in git?
  • One Solution collect form web for “publickey-authentication on git/stash for ssh not working”

    The URL for ssh remotes should be prefixed with ssh:// and the username should be git (Stash will find the correct key for your hannibal user automatically). The full form of the URL is:


    For http URLs, you use the username and the http port (7990 by default)

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