2014-05-23 73 views
3

我剛剛用ubuntu 14.04 x64創建了一個數字海洋服務器。git remote似乎不是git倉庫(dokku)

在創建時,我設置SSH訪問,並下載dokku(運行兩次命令所需的,但它是一個常見的問題)

命令:

wget -qO- https://raw.github.com/progrium/dokku/v0.2.3/bootstrap.sh | sudo DOKKU_TAG=v0.2.3 bash 

然後,在本地我試圖連接我的本地回購和推我的代碼到我的新服務器:

$ git remote set-url amsterdam [email protected]**.**.**.** 
$ git push amsterdam master 
fatal: '[email protected]**.**.**.**' does not appear to be a git repository 
fatal: Could not read from remote repository. 

Please make sure you have the correct access rights 
and the repository exists. 

所以,我錯過了什麼?

- >請注意,我是新的,這應該是一個非常基本的問題

編輯:

起初,當我試圖添加新的遠程我輸入這樣的:

git remote set-url amsterdam [email protected]**.**.**.** 

,但得到了同樣的錯誤,這就是爲什麼我用[email protected]

ED嘗試IT 2:

我剛剛發現了一些奇怪的東西。

當我在做根LS我會得到一個名爲dokku一個文件夾中,但我我這樣做:

cd .. 
ls /home 

我再次得到dokku,但它們的內容是不同的。

在/ home/dokku我有這樣的:

drwxr-xr-x 3 dokku root 4096 May 23 10:34 . 
drwxr-xr-x 3 root root 4096 May 23 10:31 .. 
-rw-r--r-- 1 root root 8 May 23 10:33 HOSTNAME 
drwxr-xr-x 2 dokku root 4096 May 23 10:31 .ssh 
-rw-r--r-- 1 dokku root 21 May 23 10:31 .sshcommand 
-rw-r--r-- 1 root root 7 May 23 10:34 VERSION 

但在/根/ dokku我有這樣的:

drwxr-xr-x 7 root root 4096 May 23 10:31 . 
drwx------ 5 root root 4096 May 23 10:31 .. 
-rw-r--r-- 1 root root 767 May 23 10:31 AUTHORS 
-rw-r--r-- 1 root root 823 May 23 10:31 bootstrap.sh 
drwxr-xr-x 2 root root 4096 May 23 10:31 contrib 
drwxr-xr-x 2 root root 4096 May 23 10:31 docs 
-rwxr-xr-x 1 root root 3218 May 23 10:31 dokku 
-rw-r--r-- 1 root root 1224 May 23 10:31 dokku.1 
drwxr-xr-x 8 root root 4096 May 23 10:31 .git 
-rw-r--r-- 1 root root 29 May 23 10:31 .gitignore 
-rw-r--r-- 1 root root 813 May 23 10:31 HISTORY.md 
-rw-r--r-- 1 root root 1056 May 23 10:31 LICENSE 
-rw-r--r-- 1 root root 2330 May 23 10:31 Makefile 
drwxr-xr-x 7 root root 4096 May 23 10:31 plugins 
-rw-r--r-- 1 root root 9092 May 23 10:31 README.md 
-rw-r--r-- 1 root root 1087 May 23 10:31 .s3cfg 
drwxr-xr-x 4 root root 4096 May 23 10:31 tests 
-rw-r--r-- 1 root root 486 May 23 10:31 .travis.yml 

-RW-R - R-- 1根根1377 5月23日10:31 Vagrantfile

回答

1

如果你想創建一個新的遙控器,你應該用:

git remote add amsterdam [email protected]代替git remote set-url amsterdam [email protected]

其中,amsterdam(名稱無關緊要)只是[email protected](您提供的網址)的別名。

set-url用於更新現有遠程位置的URL。

有幾個點要注意:

  • 櫃面你尚未初始化git倉庫還沒有,請鍵入:在你的項目目錄git init .

  • 下一步是將更改添加到本地git索引。這樣做鍵入:
    git add .

  • 然後,記錄切換到本地的Git倉庫。要這樣輸入:
    git commit -m 'some-commit-message'

  • 最後,將更改推送到遠程服務器。要這樣做,請鍵入:
    git push amsterdam master,其中master是您的分支的名稱,默認爲master