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

你说的曾经没有我的故事 提交于 2019-11-27 04:40:46

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://rvc@192.168.1.65:5858/SSH/home/rvc/myapp.git
   680f32e..2da0df1  master -> master

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...

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

Tim

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?]

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!