Clone works, remote push doesn't. Remote repository over copssh

Solution 1:

stupid fix (this changed /SSH/home/rvc/.gitconfig):

rvc@RVC-DESKTOP /c/code/myapp (master)
$ git config --global remote.origin.receivepack "git receive-pack"

rvc@RVC-DESKTOP /c/code/myapp (master)
$ git push
Counting objects: 3, done.
Delta compression using up to 4 threads.
Compressing objects: 100% (2/2), done.
Writing objects: 100% (2/2), 246 bytes, done.
Total 2 (delta 0), reused 0 (delta 0)
To ssh://[email protected]:5858/SSH/home/rvc/myapp.git
   680f32e..2da0df1  master -> master

Solution 2:

Found the answer...

GIT_SSH

If this environment variable is set then git fetch and git push will

use this command instead of ssh when they need to connect to a remote system. The $GIT_SSH command will be given exactly two arguments: the username@host (or just host) from the URL and the shell command to execute on that remote system.

To pass options to the program that you want to list in GIT_SSH you

will need to wrap the program and options into a shell script, then set GIT_SSH to refer to the shell script.

Usually it is easier to configure any desired options through your

personal .ssh/config file. Please consult your ssh documentation for further details.

I just had to delete the GIT_SSH var from the windows environment variables.

I've had it set because I was following Tim Davis' guide, but without using TortoiseGit, and the guide says to point the variable to TortoisePlink (step 4.4), so I assumed I had to pointed to plink.exe :P. O well.. moving to the next problem...

Solution 3:

Thank you! I was also getting the error

git: '/pathToRepo/myRepoName.git' is not a git command See 'git --help'.
fatal: The remote end hung up unexpectedly

the git config command worked for me.

git config --global remote.origin.receivepack "git receive-pack"

I am running MSysGit-1.7.3.1

Solution 4:

1) most often cause of this prob - Open a Git Bash window and type echo $HOME – ensure it is set to /c/SSH/Home/<user>/. If it is not – enter export HOME=/c/SSH/home/<user>

2) try the GUI interface [same prob?]