【问题标题】:deploy Github public project (PHP) on dedicated server在专用服务器上部署 Github 公共项目(PHP)
【发布时间】:2019-06-18 01:34:44
【问题描述】:

我的项目是在 github 上开发的,现在我想将它部署到专用服务器,任何帮助将不胜感激。

【问题讨论】:

  • 只需在其上安装 Git 并执行 git pull? - 此外,投票结束广泛
  • 但我是否需要更改任何代码或配置以使其正常工作或其他?
  • 我不知道,我怎么知道您需要在自己的代码中更改什么?
  • 我没有任何使用 github 的经验,所以当我尝试从 repo 下载代码时,它会提供大量文件和目录,所以如果我执行 git pull 是否只导入应用程序或整个 repo 的代码?跨度>
  • 那么学习一些教程并阅读一下 Git 和 GitHub 是什么、它们的不同之处以及它们的共同点可能是件好事。

标签: php git amazon-web-services github


【解决方案1】:

1) 使用 SSH 登录到您的专用服务器。

  • windows 使用腻子
  • 对于 ubuntu 和 mac 使用终端

2) 在您的专用服务器上安装 git。 how to install ?

3) 之后是下面的逗号:

克隆存储库git clone https://github.com/username/repositoryname.git

进入存储库cd repositoryname

之后,如果您在代码编辑器中添加一些新代码,请在 您的本地 git 存储库中使用以下命令:

git add .                    // this will add your code to local git repo
git commit -m "code updated" // this will commit your changes in local git repo
git push                     // this will push your code from local git repo to github repo

之后转到 ssh ,转到服务器上的存储库并使用以下命令提取最新代码:

git pull     //it will pull your code to your server .

【讨论】:

    猜你喜欢
    • 2021-07-21
    • 1970-01-01
    • 2014-05-11
    • 1970-01-01
    • 2021-04-24
    • 2019-10-02
    • 2018-07-09
    • 2012-12-13
    • 2015-06-16
    相关资源
    最近更新 更多