git remote does not appear to be a git repository (dokku)

半城伤御伤魂 提交于 2019-12-10 18:05:28

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/23832246/git-remote-does-not-appear-to-be-a-git-repository-dokku

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!