can't deploy git repository to dokku instance (fatal: {reponame} does not appear to be a git repository)

I’m trying to deploy my application which is located on my local git repo to my dokku instance on digitalocean.

Zone file

  • deploying to digital ocen from bitbucket - Permission denied (publickey) error
  • Dokku push resulting in broken pipe when deploying to Digital Ocean
  • Cannot push git repo to Dokku remote on Digital Ocean droplet?
  • Access node app on digital ocean - This site can't be reached
  • Ubuntu / DigitalOcean - Unable to fetch packages to install git on a fresh install
  • Rails 4 + Capistrano 3 : fatal: Could not read from remote repository while deploying
  • $ORIGIN mydomain.com.
    $TTL 1800
    ...
    mydomain.com. 1800 IN A 11.22.33.44
    www.mydomain.com. 1800 IN CNAME mydomain.com.
    *.mydomain.com. 1800 IN A 11.22.33.44
    test.mydomain.com. 1800 IN A 11.22.33.44
    

    I intend to deploy my app on test.mydomain.com

    dokku setup

    I used the dokku image on digitalocean to setup the server, which currently runns on dokku v0.4.15, and tried to deploy my app according to the guide which is obviousely obsolete, however, I didn’t find a more recent one.

    ssh setup

    I also set up the SSH keys and config file, so I’m able to log in to my dokku instance over SSH for both users root and dokku:

    ssh {username}@test.localhome.ch // works

    local ssh config file

    Host          mydomain.com test.mydomain.com
            HostName       11.22.33.44
            IdentityFile   ~/.ssh/mydomain
            PreferredAuthentications publickey
    

    deployment

    When I try to deploy my git repo:

    git remote add dokku dokku@test.mydomain.com:test
    git push dokku master
    

    it would throw me

    fatal: 'test' 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.
    

    What did I miss?

    Edit 1

    I also ssh’ed into the server and added the dokku app

    ssh dokku@mydomain.com
    dokku apps:create test
    

    The app seems to have been added correctly server-side..

    dokku@mydomain:~$ dokku apps
    =====> My Apps
    test
    

    .. however, the push is still failing.

  • Is it possible to clone a git repo when given "<IP Address>:/<Path to App> with Jenkins
  • Removing untracked files
  • Which branch do commits from a deleted branch belong to?
  • cannot checkout .gitattributes
  • Ignoring directories in Git repos on Windows
  • Set file as non-binary in git
  • 2 Solutions collect form web for “can't deploy git repository to dokku instance (fatal: {reponame} does not appear to be a git repository)”

    I wasn’t able to solve the problem for the oneclick dokku-installation on digitalocean, so instead, I had to setup the instance manually, which wasn’t that hard.

    Dokku setup

    1. Create a new Ubuntu 14.04.4 x64 droplet.
    2. Don’t setup the RSA yet, use password authentication to login to the droplet.
    3. Install dokku:

      wget https://raw.githubusercontent.com/dokku/dokku/v0.5.2/bootstrap.sh
      sudo DOKKU_TAG=v0.5.2 bash bootstrap.sh

    Setup RSA

    Assumption: We don’t use the default RSA key (usually .ssh/id_rsa.pub), but instead a custom one: .ssh/custom.pub

    1. add the public key using the following one-liner

      cat ~/.ssh/custom.pub | ssh root@mydomain.com “sudo sshcommand acl-add dokku custom-identifier”

    For more information please refer to this page

    Deploy repo

    Deploy your repo, for a quick test this example can be used.
    Also, the DNS need to be setup accordingly (if the apps name is test, then test.mydomain.com should point to your servers IP, as also shown in the OP).

    The most current instructions are on dokku.viewdocs.io: Deploying to Dokku

    Create the application on the Dokku host. You will need to ssh onto the host to run this command.

    # on your dokku host
    dokku apps:create ruby-rails-sample
    

    (In your case, you would create ‘test‘)

    That should be enough to create a remote git repo for you to push to.

    Git Baby is a git and github fan, let's start git clone.