簡體   English   中英

無法克隆我的Git存儲庫

[英]Can't clone my Git repository

所以,我已經在我的liverserver上建立了我的第一個Git存儲庫,成功地將它克隆到了一個子域(我想用作登台服務器)。 現在我想將它克隆到Github和我的本地計算機,但我不能。 我按照github提供的步驟,嘗試所有克隆協議。 以下只是我嘗試過的一個小概述。

Kasper-Srensens-MacBook-Pro:wordpress Kasper$ ssh kasperso@kaspersorensen.com
kasperso@kaspersorensen.com's password: 
Last login: Tue Feb 15 15:35:13 2011 from 0x57368359.sdbnqu1.dynamic.dsl.tele.dk
kasperso@kaspersorensen.com [~]# cd www/wp-content/
kasperso@kaspersorensen.com [~/www/wp-content]# git status
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   backup-d2490/
#   backup-db/
#   blogs.dir/
#   bte-wb/
#   index.php
#   sunrise.php
#   uploads/
nothing added to commit but untracked files present (use "git add" to track)
kasperso@kaspersorensen.com [~/www/wp-content]# logout

Connection to kaspersorensen.com closed.
Kasper-Srensens-MacBook-Pro:wordpress Kasper$ git clone git://kaspersorensen.com/wp-content.git
Cloning into wp-content...
kaspersorensen.com[0: 74.220.202.12]: errno=Operation timed out
fatal: unable to connect a socket (Operation timed out)
Kasper-Srensens-MacBook-Pro:wordpress Kasper$ git clone ssh://kaspersorensen.com/wp-content.git wp-content/
Cloning into wp-content...
Kasper@kaspersorensen.com's password: 
Permission denied, please try again.
Kasper@kaspersorensen.com's password: 
Permission denied, please try again.
Kasper@kaspersorensen.com's password: 
Permission denied (publickey,password).
fatal: The remote end hung up unexpectedly
Kasper-Srensens-MacBook-Pro:wordpress Kasper$ No! I'm nor writing the password worng. It's crazy!
-bash: No!: command not found
Kasper-Srensens-MacBook-Pro:wordpress Kasper$ ssh kasperso@kaspersorensen.com
kasperso@kaspersorensen.com's password: 
Last login: Tue Feb 15 15:40:27 2011 from 0x57368359.sdbnqu1.dynamic.dsl.tele.dk
kasperso@kaspersorensen.com [~]# cd www/wp-content/
kasperso@kaspersorensen.com [~/www/wp-content]# git status
# On branch master
# Untracked files:
#   (use "git add <file>..." to include in what will be committed)
#
#   backup-d2490/
#   backup-db/
#   blogs.dir/
#   bte-wb/
#   index.php
#   sunrise.php
#   uploads/
nothing added to commit but untracked files present (use "git add" to track)
kasperso@kaspersorensen.com [~/www/wp-content]# git remote add origin git@github.com:kasperbs/wp-content.git
fatal: remote origin already exists.
kasperso@kaspersorensen.com [~/www/wp-content]# 
git clone git://kaspersorensen.com/wp-content.git

失敗是因為您可能沒有運行git-daemon。

git clone ssh://kaspersorensen.com/wp-content.git wp-content/

失敗是因為您的本地用戶名和遠程用戶名不同,因此您需要將遠程用戶名添加到URL。


git clone kasperso@kaspersorensen.com:www/wp-content

是唯一可能基於您提供的信息運行的命令。

請注意,這不是使用ssh:// url模式。 您沒有向我們提供絕對路徑,因此無法知道使用ssh:// url的正確URL是什么。 此外, www目錄已添加到URL,並且.git已被刪除以匹配顯示的路徑。


編輯: bash: git-upload-pack: command not found fatal: The remote end hung up unexpectedly

您收到此錯誤是因為git未安裝到默認的$ PATH中。 它可能安裝在/usr/local/bin/git 通過更改服務器上的內容來解決此問題的唯一方法是在與服務器交互的所有命令上使用-u選項。

在服務器上運行which git-upload-pack然后使用以下命令中的位置。

 git clone -u /path/to/git-upload-pack kasperso@kaspersorensen.com:www/wp-content 

請嘗試以下方法:

git clone kasperso@kaspersorensen.com:www/wp-content

當您從您的項目中復制.git目錄到另一個位置,並將其命名為您-repo.git你,repo.git方式工作。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM