2010-04-29 13 views
10

Mam "setup-a-msysgit-server-with-copssh-on-windows", po Tim Davis 'guide i uczyłem się teraz korzystać z poleceń git, po Jason Meridth w guide i Udało mi się sprawić, że wszystko działa poprawnie, ale teraz nie mogę przekazać polecenia push.GIT: klon działa, zdalne push nie. Zdalne repozytorium przez copssh

Ustawiłem serwer i klienta na tym samym komputerze (na razie), win7-x64.

Oto kilka informacji o tym, jak rzeczy są ustawione:

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' i '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} 

więc klonowanie prac (wszystko odbywa się poprzez mieszek "Git Bash tu": 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) 

Potem utworzyć plik:

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

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

Spróbuj wcisnąć go i uzyskać ten błąd:

[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 

„git: '/SSH/home/rvc/myapp.git' nie jest poleceniem git. Patrz '--help git' „.. co ?!

EDIT:. RAAAGE !!

ja znowu ten sam problem, ale teraz z 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 
.

próbowałem GUI pchnięcie i pokazuje ten sam komunikat

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 

Oto prądy .bashrc:

C: \ Users \ rvc.bashrc (myślę, że to jest używane tylko przez 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 (.. i ten jest używany podczas git łączy się przez ssh do "zdalnego" serwer):

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: Niektóre dodatkowe info:

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


EDIT 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 

Ma to załatwiło sprawę ??

git push uruchamia pakiet "git-receive-pack", a powinien to być "git receive-pack"?

Moja wersja git to "git version 1.7.0.2.msysgit.0 '

Odpowiedz

11

głupi fix (ta zmieniła /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) najczęściej przyczyną tego prob - Otwórz okno Git Bash i wpisz echo $HOME - upewnij się, że jest ustawiony na /c/SSH/Home/<user>/. Jeśli tak nie jest - wpisz export HOME=/c/SSH/home/<user>

2) spróbować interfejs GUI

1

Okazało się 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.

po prostu musiałem usunąć var ​​GIT_SSH z okien [sam prob?] Zmienne środowiska.

miałem go ustawić, bo byłem po prowadnicy Tima Davisa, ale bez użycia TortoiseGit, i przewodnik mówi wskazać zmienną TortoisePlink (etap 4.4), więc ja musiałem założyć wskazał Plink .exe: P. O dobrze .. przejściem do następnego problemu ...

1

Dziękujemy! Otrzymałem również komunikat o błędzie, ponieważ dla mnie działa polecenie git config.

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

Używam msysgit-1.7.3.1

Powiązane problemy