For some repositories at work I get the following message when I try to push my commits:
GitError! Could not read from remote repository. [Type `$' for details]
The details read:
128 C:/Program Files/Git/mingw64/libexec/git-core/git.exe … "push" "-v" "origin" "master:refs/heads/master" Pushing to ssh://git@XXX.git fatal: Could not read from remote repository. Please make sure you have the correct access rights and the repository exists.
Any idea what the problem could be? Running the above git command from a git-bash (minus those tripple-dots) also works. In fact, that's my workaround. Compose the commit with magit and just type git push in a git-bash. Pushing to github.com repository on the same machine works from magit.
128...line to actually see the details.
ssh://..., you must be using SSH keys to authenticate against the repository. I'd start by making sure that
$HOMEto the same directory as
M-x getenv HOME. Or, perhaps, you are running an
ssh-agentprogram that manages the keys for you, but it runs in the
git-bashsession, and not in Emacs (so you would need to start
ssh-agentin Emacs too).