GIT:克隆工作,远程推送不。通过copssh远程存储库 [英] GIT: clone works, remote push doesn't. Remote repository over copssh
问题描述
我在安装了戴维斯的 guide ,我现在正在学习如何使用git命令,在Jason Meridth的指南 ,我已经设法使一切正常工作,但现在我无法传递push命令。
我已经将服务器和客户端设置在同一台计算机上
以下是一些如何设置的信息:
CopSSH文件夹:C:/ SSH /
本地主文件夹:C:/ Users / rvc /
远程主文件夹:C:/ SSH / home / rvc /#aka / cygdrive / c / SSH / home / rvc /
git remote rep:C:/SSH/home/rvc/myapp.git#empty rep
在'/SSH/home/rvc/.ba shrc'和'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 here完成的:P):
rvc @ RVC-DESKTOP / c / code
$ git clone ssh://rvc@192.168.1.65:5858 / SSH / home / rvc / myapp.git
在C:/code/myapp/.git/
中初始化了空的Git仓库:您似乎克隆了一个空的存储库。
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(推)
然后我创建一个文件:
rvc @ RVC-DESKTOP / c / code / myapp(master)
$ touch test.file
rvc @ RVC-DESKTOP / c / code / myapp(master)
$ ls
test.file
尝试推送它并得到这个错误:
rvc @ RVC-DESKTOP / c /代码/ 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 \
混帐:‘/SSH/home/rvc/myapp.git’不是一个git命令。参见'git --help'。
致命:远程端意外挂起
git:'/ SSH / home / rvc / myapp.git'不是git命令,参见'git --help'。 ...什么?!
编辑:
RAAAGE !!
我再次遇到同样的问题,但现在使用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 '不是git命令。参见'git --help'。
致命:远程终端意外挂起
我尝试了GUI推送,并显示同样的信息。
git:'/SSH/home/rvc/myapp.git'不是git命令。参见'git --help'。
推送到ssh://rvc@192.168.1.65:5858 / SSH / home / rvc / myapp.git
致命:远程端意外挂起
以下是目前的.bashrc:
C:\Users\rvc.bashrc我认为这只用于cygwin / git bash):
$ b $ pre $ 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连接到 >
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}
编辑2:
一些额外信息:
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'不是git命令。参见'git --help'。
编辑3:
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
计数对象:3,完成。
写入对象:100%(3/3),202字节,完成。
总计3(delta 0),重用0(delta 0)
到ssh://rvc@192.168.1.65:5858 / SSH / home / rvc / myapp.git
* [new分支] master - > master
有没有这个窍门?
< git push is running'git-receive-pack',它应该是'git receive-pack'?
我的git版本是'git version 1.7.0.2 .msysgit.0'
愚蠢的修复(改变/SSH/home/rvc/.gitconfig):
$ $ p $ code $ 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
计数对象:3,完成。
使用多达4个线程的增量压缩。
压缩对象:100%(2/2),完成。
写入对象:100%(2/2),246字节,完成。
总计2(delta 0),重用0(delta 0)
到ssh://rvc@192.168.1.65:5858 / SSH / home / rvc / myapp.git
680f32e .. 2da0df1 master - >主
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.
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
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}
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)
Then I create a file:
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' is not a git command. See 'git --help'." .. what?!
EDIT: RAAAGE!!
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
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
Here's the currents .bashrc:
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 (.. 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}
EDIT 2: Some additional info:
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'.
EDIT 3:
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
Has this did the trick??
git push is running 'git-receive-pack', and it should be 'git receive-pack' ?
My git version is 'git version 1.7.0.2.msysgit.0'
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
这篇关于GIT:克隆工作,远程推送不。通过copssh远程存储库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!