2016-01-20 60 views
1

我已經安裝了git共享主機,我在某個目錄上創建了存儲庫,並對文件進行了一些更改並進行了提交。
現在我需要回到我的電腦本地版本的變化。從共享主機bluehost獲取git存儲庫

問題是我無法使用遠程命令獲取存儲庫路徑。

我用:

git init 

創建存儲庫。

命令:

git config --get remote.origin.url 

回報空白

我不能使用:

git clone 

的路徑是錯誤的。

這就是生命的主

[core] 
    repositoryformatversion = 0 
    filemode = true 
    bare = false 
    logallrefupdates = true 

我應該使用什麼命令克隆我的本地工作站上的遠程BlueHost的回購我的配置文件?

回答

1

如果你有enabled ssh access to your Bluehost server,通過git clone命令會(見ssh connection):

git clone [email protected]:path/to/repo.git 

替換:

  • username通過對BlueHost的用戶名,
  • yourserver由BlueHost的服務器fqn(完全合格的名稱)
  • path/to/repo.git the relat你的家在回購的IVE路徑:/home/username/path/to/repo.git
+0

我使用bitvise ssh連接到服務器,我不能找到哪裏是repo.git文件我在git的目錄看上去沒有用的東西。git的擴展 – Roufail

+0

確定好什麼當我從git bash登錄你的指令這是重播 似乎不是一個混帳存儲庫 我導航到我的項目路徑中,我可以得到repo.git文件 – Roufail

+0

@Roufail那麼你需要ssh到你的服務器,並在/ home/username你創建一個裸回購:'git init --bare myrepo.git'。然後在你的本地倉庫中,你可以'git遠程添加用戶名@你的服務器:/ home/username/myrepo.git',和'git push -u origin master' – VonC