如何设置根应用程序目录?

编程入门 行业动态 更新时间:2024-10-26 00:19:34
本文介绍了如何设置根应用程序目录?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我已经创建了我的第一个液滴,但我不知道如何设置根应用程序目录? 我尝试在 / home / dokku / app_name 中为我的应用程序名称创建一个文件夹然后,我做了 cd app_name 然后 git init 然后我添加了一个远程回购:

git remote add dokku root@do.mydomain:app_name

但是,当试图推动我得到错误:

致命:'app_name'似乎不是一个git存储库致命:远程终端意外挂起

如何配置?如何设置根应用程序目录?

解决方案

如果您还没有:

(在服务器上)

  • 以root身份登录到服务器。 cd〜(转到根目录dir)
  • cd app_name
  • git init --bare (它应该给你提示它初始化了一个git仓库)
  • (本地系统)

  • cd app_name
  • git init (它会给你提示它初始化了一个git仓库)
  • git add 。(将当前目录中的所有文件分阶段提交)
  • git commit
  • git remote add dokku root@do.mydomain:app_name
  • git推送dokku master (第一次需要给出分支的名称,因为远程仓库没有任何分支。
  • 希望这可以解决您的问题!

    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: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?

    解决方案

    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: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!

    更多推荐

    如何设置根应用程序目录?

    本文发布于:2023-11-11 21:20:54,感谢您对本站的认可!
    版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
    本文标签:应用程序   如何设置   目录

    发布评论

    评论列表 (有 0 条评论)
    草根站长

    >www.elefans.com

    编程频道|电子爱好者 - 技术资讯及电子产品介绍!