克隆有效,远程推送无效. Copssh上的远程存储库 [英] Clone works, remote push doesn't. Remote repository over copssh

查看:95
本文介绍了克隆有效,远程推送无效. Copssh上的远程存储库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在蒂姆·戴维斯(Tim Davis)的

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, and I have managed to get everything working fine, but now I can't pass the push command.

我已经将服务器和客户端设置在同一台计算机上(现在),即win7-x64.

I have set the server and the client on the same machine (for now), win7-x64.

以下是有关设置方式的一些信息:

Here is some info of how things are set up:

CopSSH Folder     : C:/SSH/
Local Home Folder : C:/Users/rvc/
Remote Home Folder: C:/SSH/home/rvc/          # aka /cygdrive/c/SSH/home/rvc/
git remote rep    : C:/SSH/home/rvc/myapp.git # empty rep

在"/SSH/home/rvc/.bashrc"和用户/rvc/.bashrc"中:

At '/SSH/home/rvc/.bashrc' and 'Users/rvc/.bashrc':

export HOME=/cygdrive/c/SSH/home/rvc
gitpath='/cygdrive/c/Program Files (x86)/Git/bin'    
gitcorepath='/cygdrive/c/Program Files (x86)/Git/libexec/git-core'
PATH=${gitpath}:${gitcorepath}:${PATH}

因此,克隆工作正常(所有的事情都通过这里的Git Bash"完成:P):

So, cloning works (everything bellow is done via "Git Bash here" :P):

rvc@RVC-DESKTOP /c/code
$ git clone ssh://rvc@192.168.1.65:5858/SSH/home/rvc/myapp.git
Initialized empty Git repository in C:/code/myapp/.git/
warning: You appear to have cloned an empty repository.

rvc@RVC-DESKTOP /c/code
$ cd myapp

rvc@RVC-DESKTOP /c/code/myapp (master)
$ git remote -v
origin  ssh://rvc@192.168.1.65:5858/SSH/home/rvc/myapp.git (fetch)
origin  ssh://rvc@192.168.1.65:5858/SSH/home/rvc/myapp.git (push)

然后我创建一个文件:

rvc@RVC-DESKTOP /c/code/myapp (master)
$ touch test.file

rvc@RVC-DESKTOP /c/code/myapp (master)
$ ls
test.file

尝试将其推入并出现此错误:

Try to push it and get this error:

rvc@RVC-DESKTOP /c/code/myapp (master)
$ git add test.file

rvc@RVC-DESKTOP /c/code/myapp (master)
$ GIT_TRACE=1 git push origin master
trace: built-in: git 'push' 'origin' 'master'
trace: run_command: 'C:\Users\rvc\bin\plink.exe' '-batch' '-P' '5858' 'rvc@192.1
68.1.65' 'git-receive-pack '\''/SSH/home/rvc/myapp.git'\'''
git: '/SSH/home/rvc/myapp.git' is not a git command. See 'git --help'.
fatal: The remote end hung up unexpectedly

"git:'/SSH/home/rvc/myapp.git'不是git命令.请参阅'git --help'." ..什么?!

"git: '/SSH/home/rvc/myapp.git' is not a git command. See 'git --help'." .. what?!

疯狂!

我再次遇到相同的问题,但是现在使用ssh:

I'm having the same problem again, but now with ssh:

rvc@RVC-DESKTOP /c/code/myapp (master)
$ GIT_TRACE=1 git push
trace: built-in: git 'push'
trace: run_command: 'ssh' '-p' '5858' 'rvc@192.168.1.65' 'git-receive-pack '\''/
SSH/home/rvc/myapp.git'\'''
git: '/SSH/home/rvc/myapp.git' is not a git command. See 'git --help'.
fatal: The remote end hung up unexpectedly

我尝试过GUI推送,并显示相同的消息.

I've tried GUI push, and shows the same message.

git: '/SSH/home/rvc/myapp.git' is not a git command. See 'git --help'.
Pushing to ssh://rvc@192.168.1.65:5858/SSH/home/rvc/myapp.git
fatal: The remote end hung up unexpectedly

这是.bashrc的电流:

Here's the currents .bashrc:

C:\ Users \ rvc.bashrc(我认为这仅由cygwin/git bash使用):

C:\Users\rvc.bashrc (I think this is used only by cygwin/git bash):

export HOME=/c/SSH/home/rvc

gitpath='/c/Program Files (x86)/Git/bin'

gitcorepath='/c/Program Files (x86)/Git/libexec/git-core'
export GIT_EXEC_PATH=${gitcorepath}

PATH=${gitpath}:${gitcorepath}:${PATH}

C:\ SSH \ home \ rvc.bashrc(..,当git通过ssh连接到远程"服务器时使用):

C:\SSH\home\rvc.bashrc (.. and this is used when git connects via ssh to the "remote" server):

export HOME=/c/SSH/home/rvc

gitpath='/cygdrive/c/Program Files (x86)/Git/bin'

gitcorepath='/cygdrive/c/Program Files (x86)/Git/libexec/git-core'
export GIT_EXEC_PATH=${gitcorepath}

PATH=${gitpath}:${gitcorepath}:${PATH}

一些其他信息:

rvc@RVC-DESKTOP /c/code/myapp (master)
$ ssh -p 5858 rvc@192.168.1.65 git-receive-pack /SSH/home/rvc/myapp.git
git: '/SSH/home/rvc/myapp.git' is not a git command. See 'git --help'.


rvc@RVC-DESKTOP /c/code/myapp (master)
$ git push --receive-pack='git receive-pack' ssh://rvc@192.168.1.65:5858/SSH/home/rvc/myapp.git --a
ll
Counting objects: 3, done.
Writing objects: 100% (3/3), 202 bytes, done.
Total 3 (delta 0), reused 0 (delta 0)
To ssh://rvc@192.168.1.65:5858/SSH/home/rvc/myapp.git
 * [new branch]      master -> master

这成功了吗?

git push正在运行'git-receive-pack',应该是'git receive-pack'吗?

git push is running 'git-receive-pack', and it should be 'git receive-pack' ?

我的git版本是'git版本1.7.0.2.msysgit.0'

My git version is 'git version 1.7.0.2.msysgit.0'

推荐答案

愚蠢的修复(此更改为/SSH/home/rvc/.gitconfig):

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

这篇关于克隆有效,远程推送无效. Copssh上的远程存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆