2010-04-29 5 views
10

Tim Davis의 guide에 이어 "setup-a-msysgit-server-with-copssh-on-windows"를했는데 Jason Meridth의 guide에 따라 git 명령을 사용하는 방법을 배우고있었습니다. 모든 일을 잘 처리 할 수 ​​있었지만 지금은 밀어 넣기 명령을 전달할 수 없습니다.GIT : 클론이 작동하지만 원격 푸시가 작동하지 않습니다.

win7-x64와 같은 컴퓨터 (현재)에 서버와 클라이언트를 설정했습니다.

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에':

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} 
다음

물건이 설정되는 방법에 대한 몇 가지 정보입니다

그래서, 작품을 복제 (모든 우는 소리 "여기 힘내 강타"을 통해 이루어집니다 : P) :

[email protected] /c/code 
$ git clone ssh://[email protected]:5858/SSH/home/rvc/myapp.git 
Initialized empty Git repository in C:/code/myapp/.git/ 
warning: You appear to have cloned an empty repository. 

[email protected] /c/code 
$ cd myapp 

[email protected] /c/code/myapp (master) 
$ git remote -v 
origin ssh://[email protected]:5858/SSH/home/rvc/myapp.git (fetch) 
origin ssh://[email protected]:5858/SSH/home/rvc/myapp.git (push) 

가 그럼 난 파일을 만듭니다

[email protected] /c/code/myapp (master) 
$ touch test.file 

[email protected] /c/code/myapp (master) 
$ ls 
test.file 

시도를 밀어이 오류를 얻을 :

[email protected] /c/code/myapp (master) 
$ git add test.file 

[email protected] /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' '[email protected] 
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 

"자식을 '/SSH/home/rvc/myapp.git는'자식 명령이 아닙니다. '자식 --help'를 참조하십시오 "..?! 무엇을

편집 :. RAAAGE!

내가하지만 지금은 ssh를 이용하여 다시 같은 문제에 봉착 :

[email protected] /c/code/myapp (master) 
$ GIT_TRACE=1 git push 
trace: built-in: git 'push' 
trace: run_command: 'ssh' '-p' '5858' '[email protected]' '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 푸시를 시도하고, 같은 메시지를 표시 한 다음

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

는 전류의 .bashrc에 :

012 3,516,

C : \ 사용자 \ rvc.bashrc (I이는 Cygwin에서/자식 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의 \ 홈 \의 rvc.bashrc (.. 이것은 자식 사용) "원격"서버에 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 : 몇 가지 추가 정보 :

[email protected] /c/code/myapp (master) 
$ ssh -p 5858 [email protected] git-receive-pack /SSH/home/rvc/myapp.git 
git: '/SSH/home/rvc/myapp.git' is not a git command. See 'git --help'. 


편집 3 :

[email protected] /c/code/myapp (master) 
$ git push --receive-pack='git receive-pack' ssh://[email protected]: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://[email protected]:5858/SSH/home/rvc/myapp.git 
* [new branch]  master -> master 

이이 속임수를 썼는지 가지고 ??

git push가 실행 중이고 'git-receive-pack'이고 'git receive-pack'이어야합니까?

내 자식 버전은 'git 버전 1.7.0.2.msysgit입니다.0 '

답변

11

바보 수정 (이 /SSH/home/rvc/.gitconfig 변경) :

[email protected] /c/code/myapp (master) 
$ git config --global remote.origin.receivepack "git receive-pack" 

[email protected] /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 
1

1) 대부분이 문제의 원인 - Git Bash 창을 열고 echo $HOME을 입력하십시오 - /c/SSH/Home/<user>/으로 설정되어 있는지 확인하십시오. 그렇지 않은 경우 - export HOME=/c/SSH/home/<user>

2)는 GUI 인터페이스를 시도 입력

1

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 [email protected] (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.

난 그냥 창에서 GIT_SSH의 VAR을 삭제했다 [같은 확률값을?] 환경 변수. 나는 그것이 내가 팀 데이비스 '가이드 다음 이었기 때문에 설정할 수 있지만 TortoiseGit, 를 사용하지 않고와 가이드가 TortoisePlink (단계 4.4)에 변수를 가리 키도록 말한다, 그래서 가 가용 스루풋하는 지적에 나는 내가 가진 가정 했어

.exe : P. 또한 O .. 다음 문제로 이동 ...

1

감사합니다! 또한 오류가 발생했습니다.

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

git config 명령이 작동했습니다.

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

나는 MSysGit - 1.7.3.1

를 실행하고