git remote似乎不是一个git仓库(dokku) [英] git remote does not appear to be a git repository (dokku)

查看:306
本文介绍了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 git@**.**.**.** 
$ git push amsterdam master
致命:'git@**.**.**.**'似乎不是git存储库
致命:无法从远程存储库读取。

请确保您拥有正确的访问权限
并存在存储库。

所以,我错过了什么?

- >请注意,我是新人,这应该是一个非常基本的问题。



编辑:

首先当我尝试添加新的远程时,我输入了这个:

  git remote set-url amsterdam dokku@**.**.**.** 

但是得到了同样的错误,这就是为什么我尝试了 git @ ...



编辑2:



我发现了一些奇怪的东西。

当我在根目录下执行ls命令时,我得到一个名为 dokku ,但是这样做:

  cd .. 
ls / home

我再次获得 dokku ,但它们的内容



在/ home / dokku我有这个:

  drwxr-xr-x 3 dokku root 4096 5月23日10:34。 
drwxr-xr-x 3 root root 4096 5月23日10:31 ..
-rw -r - r-- 1根root 5月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 5月23日10:34 VERSION

但是在/ root / dokku中我有这个:

  drwxr-xr-x 7 root root 4096 May 23 10:31。 
drwx ------ 5根root 4096 5月23日10:31 ..
-rw -r - r-- 1 root root 767 5月23日10:31作者
- rw-r - r - 1 root root 823 5月23日10:31 bootstrap.sh
drwxr-xr-x 2 root root 4096 5月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 813 5月23日10:31 HISTORY.md
-rw -r - r-- 1根root 1056 5月23日10:31许可
- 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 9092 5月23日10:31 README.md
-rw -r - r-- 1 root root 1087 5月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 root root 1377 5月23日10:31 Vagra ntfile

解决方案

如果您正在尝试创建新的远程设备,则应该使用:



git remote添加amsterdam git @ ... 而不是 git remote set-url amsterdam git @ ... $ b

其中, amsterdam (名称无关紧要)只是<$ c的别名$ c> git @ ... (您提供的网址)。

set-url 用于更新现有远程位置的URL。



还有几点需要注意:
$ b因为您还没有初始化您的git存储库,请在项目目录中输入: git init。

  • / p>


  • 下一步是将更改添加到本地git索引。为此,请输入:

    git add。

  • 然后,记录更改到本地的git仓库。为此,请键入:

    git commit -m'some-commit-message'


  • 最后,将更改推送到远程服务器。为此,键入:

    git push amsterdam master ,其中 master 是分支的名称,默认为 master



  • I just created a digital ocean server with ubuntu 14.04 x64.

    When created, I set ssh access, and downloaded dokku (needed to run command twice, but it's a common issue)

    Command:

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

    Then, locally I tried to connect my local repo and push my code into my new server:

    $ git remote set-url amsterdam git@**.**.**.**
    $ git push amsterdam master
    fatal: 'git@**.**.**.**' 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.
    

    So, What am I missing?

    --> Note that I'm new and this should be a really basic question

    EDIT:

    At first when I tried to add new remote I typed this:

    git remote set-url amsterdam dokku@**.**.**.**
    

    But got the same error, that's why I tried with git@...

    EDIT 2:

    I just discovered something strange.

    When I do ls in root I get a single folder called dokku, but I I do this:

    cd ..
    ls /home
    

    I get dokku again, but the content of them is different.

    In /home/dokku I have this:

    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
    

    But in /root/dokku I have this:

    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 root root 1377 May 23 10:31 Vagrantfile

    解决方案

    If you are trying to create a new remote, you should be using:

    git remote add amsterdam git@... instead of git remote set-url amsterdam git@...

    where, amsterdam (name doesn't matter) is just an alias to git@... (the url you provide).

    set-url is used to update the URL of an existing remote location.

    There are a few more points to be noted:

    • Incase you haven't initialized your git repository yet, type: git init . in your project directory.

    • Next step is to add changes to local git index. To do so type:
      git add .

    • Then, record changes to local git repository. To do so type:
      git commit -m 'some-commit-message'

    • Finally, push the changes to remote server. To do so type:
      git push amsterdam master, where master is name of your branch, which is master by default.

    这篇关于git remote似乎不是一个git仓库(dokku)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

    查看全文
    登录 关闭
    扫码关注1秒登录
    发送“验证码”获取 | 15天全站免登陆