Selepas mewujudkan git secara tempatan, serahkan kod ke repositori. Sedia untuk memuat naik ke github.
Buat laluan:
Birdy-2:learnGit birdy$ git remote add origin http://github.com/timothydsp/learnGit.git
Birdy-2:learnGit birdy$ git push -u origin master
fatal: unable to access 'http://github.com/timothydsp/learnGit.git/': Recv failure: Connection reset by peer
Ralat mula muncul di sini, tidak dapat menyambung
Kemudian saya cuba melihat sama ada terdapat sebarang masalah dengan alamat pautan:
Birdy-2:learnGit birdy$ git remote add origin http://github.com/timothydsp/learnGit.git
fatal: remote origin already exists.
Tidak menemui masalah, cuba sambung ke github:
Birdy-2:learnGit birdy$ ssh -T git@github.com
Hi timothysdp! You've successfully authenticated, but GitHub does not provide shell access.
Jika sambungan berjaya, semak sama ada kunci awam tempatan wujud:
Birdy-2:learnGit birdy$ cd ~/.ssh
Birdy-2:.ssh birdy$ ls
id_rsa id_rsa.pub known_hosts
Semak sama ada kunci awam dalam talian adalah sama:
Birdy-2:learnGit birdy$ pbcopy <~/.ssh/id_rsa.pub
Sepatutnya tiada masalah kan? ? ? ? ?
Pergi ke sini:
Birdy-2:learnGit birdy$ ssh -T git@github.com
Hi timothysdp! You've successfully authenticated, but GitHub does not provide shell access.
Mengapa anda tidak boleh menolak atau menarik selepas berpusing-pusing seperti ini?
Anda boleh melihat projek saya dalam talian di sini.
Tolong ajar saya, senior, apa yang salah?
Seorang saudara menyebut menukar kepada HTTPS; atau ssh
Birdy-2:learnGit birdy$ git remote add origin https://github.com/timothysdp/learnGit.git
fatal: remote origin already exists.
Birdy-2:learnGit birdy$ git remote add origin git@github.com:timothysdp/learnGit.git
fatal: remote origin already exists.
Birdy-2:learnGit birdy$ git push -u origin master
fatal: unable to access 'http://github.com/timothydsp/learnGit.git/': Recv failure: Connection reset by peer
Nampaknya masih tidak berkesan~~
Cuba tukar ke https
asal http://github.com/timothydsp/learnGit.git
Tukar kepada alamat https atau ssh
[cawangan baharu] tuan ->