2010-04-29 3 views
10

J'ai "setup-a-msysgit-server-avec-copssh-on-windows", après guide de Tim Davis et j'apprends maintenant à utiliser les commandes git, en suivant les guide de Jason Meridth, et J'ai réussi à obtenir tout fonctionne bien, mais maintenant je ne peux pas passer la commande de poussée.GIT: clone fonctionne, la télécommande ne fonctionne pas. Référentiel distant sur copssh

J'ai défini le serveur et le client sur la même machine (pour l'instant), win7-x64.

Voici quelques informations de la façon dont les choses sont mises en place:

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 

A '/SSH/home/rvc/.bashrc' et '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} 

Ainsi, les travaux de clonage (tout est fait ci-dessous via "Git Bash ici": 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) 

Puis-je créer un fichier:

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

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

Essayez de le pousser et obtenir cette erreur:

[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' est pas une commande git. Voir '--help git' « .. quoi ?!

EDIT:. RAAAGE !!

Je vais avoir le même problème, mais maintenant avec 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 
.

J'ai essayé de pousser l'interface graphique, et montre le même message

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 

est ici les courants .bashrc:

C: \ Users \ rvc.bashrc (Je pense que ceci est utilisé que par Cygwin/bash git):

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 (.. et ceci est utilisé lorsque git se connecte via ssh au serveur "à distance"):

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: Quelques infos supplémentaires:

[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 

A ce fait le tour ??

git push exécute 'git-receive-pack', et il devrait être 'git receive-pack'?

Ma version git est 'git version 1.7.0.2.msysgit.0 '

Répondre

11

fixer stupide (cela a changé /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) le plus souvent la cause de ce prob - Ouvrez une fenêtre Git Bash et tapez echo $HOME - assurez-vous qu'il est réglé sur /c/SSH/Home/<user>/. Dans le cas contraire - entrer export HOME=/c/SSH/home/<user>

2) essayer l'interface GUI

1

Trouvé le 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.

Je viens de supprimer le GIT_SSH var des fenêtres [même prob?] Variables d'environnement.

Je l'ai eu fixé parce que je suivais le guide de Tim Davis, mais sans utiliser TortoiseGit, et le guide dit pour pointer la variable à TortoisePlink (étape 4.4), donc je suppose que je devais pointé plink .exe: P. O bien .. passer au prochain problème ...

1

Merci! Je recevais également l'erreur

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

la commande git config a fonctionné pour moi.

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

Je suis en cours d'exécution msysGit-1.7.3.1

Questions connexes