问题
I have created my first droplet, but I don't know how to set the root application directory?
I tried to create a folder for my app name in /home/dokku/app_name
Then, I did cd app_name
and then git init
Then I added a remote repo:
git remote add dokku root@do.mydomain.com:app_name
But, when try to push I get error:
fatal: 'app_name' does not appear to be a git repository
fatal: The remote end hung up unexpectedly
How to configure this? How to set the root application directory?
回答1:
Follow the following steps if you haven't:
(on server)
- Login to server as root. cd ~ (Go to home dir of root)
cd app_name
git init --bare
(It should give you message that it initialized a git repo)
(Local System)
cd app_name
git init
(It should give you message that it initialized a git repo)git add .
(to stage all files in current dir to commit)git commit
git remote add dokku root@do.mydomain.com:app_name
git push dokku master
(first time you need to9 give the name of branch to push as remote repo does not have any branch of itself yet.
Hope this solves your prob!
来源:https://stackoverflow.com/questions/25971580/how-to-set-the-root-application-directory