2009-09-30 11 views
7

J'ai cloné mon dépôt GitHub ici à la maison, et j'ai visiblement vissé quelque chose. Quoi qu'il en soit, j'ai fait beaucoup de changements, ou j'ai effacé le répertoire et tout recommencer.Je ne peux pas appuyer sur GitHub sur cette case

D'abord, quand je fais ssh [email protected] je reçois le texte suivant:

PTY allocation request failed on channel 0 ERROR: Hi asdfadfs! You've successfully authenticated, but GitHub does not provide shell access Connection to github.com closed.

Je reçois une erreur, mais il me dit que j'ai authentifié avec succès?

git add . 
git commit -a -m "hello" 
git push origin master 
[master 74a5e82] hello 
3 files changed, 45 insertions(+), 12 deletions(-) 
fatal: The remote end hung up unexpectedly 

Cela ne fonctionne évidemment pas. Je suis nouveau à git, maintenant lorsque je tente de commettre ce Happens:

git add . 
git commit -a -m "hello" 
git push origin master 
# On branch master 
nothing to commit (working directory clean) 
fatal: The remote end hung up unexpectedly 

Et enfin, git pull?

$ git pull 
You asked me to pull without telling me which branch you 
want to merge with, and 'branch.master.merge' in 
your configuration file does not tell me either. Please 
specify which branch you want to merge on the command line and 
try again (e.g. 'git pull <repository> <refspec>'). 
See git-pull(1) for details. 

If you often merge with the same branch, you may want to 
configure the following variables in your configuration 
file: 

branch.master.remote = <nickname> 
branch.master.merge = <remote-ref> 
remote.<nickname>.url = <url> 
remote.<nickname>.fetch = <refspec> 

See git-config(1) for details. 

Voici mon .git/config

[core] 
     repositoryformatversion = 0 
     filemode = true 
     bare = false 
     logallrefupdates = true 
     ignorecase = true 
[branch "master"] 
[remote "origin"] 
     url = git://github.com/my/project.git 
     fetch = +refs/heads/*:refs/remotes/origin/* 

Cette variable url indique en fait à mon URL git correcte. Merci.

Répondre

10

Utilisez ssh:// dans votre fichier .git/config, et non git://. git:// est uniquement utilisé pour cloner un référentiel. Directement de mon dépôt Libcloud - J'utilise « vaisseau mère » pour des raisons non pertinentes à ce poste:

[remote "mothership"] 
    url = ssh://[email protected]/jedsmith/libcloud.git 
    fetch = +refs/heads/*:refs/remotes/origin/* 

L'indice devrait être que vous utilisez ssh pour tester votre connectivité ...

+1

Duh. Longue journée. Merci. – mculp

+0

Moi aussi, je te sens. :) –

+0

Un moyen facile de résoudre ce problème est d'ajouter ceci à votre fichier '~/.gitconfig': https://gist.github.com/412f0b1c8841cceed750 – henrikhodne