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

前端 未结 4 1033
失恋的感觉
失恋的感觉 2020-11-30 09:16

I\'ve \"setup-a-msysgit-server-with-copssh-on-windows\", following Tim Davis\' guide and I was now learning how to use the git commands, following Jason Meridth\'s guide, an

相关标签:
4条回答
  • 2020-11-30 09:45

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

    0 讨论(0)
  • 2020-11-30 09: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
    
    0 讨论(0)
  • 2020-11-30 09:49

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

    0 讨论(0)
  • 2020-11-30 09:51

    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

    0 讨论(0)
提交回复
热议问题