是否可以将代码从Cloudways应用程序部署到空的git存储库?我想知道是否有可能,因为我目前正在使用FTP (Filezilla)。我可以将一个活动站点克隆到一个暂存站点,但不能将它部署到Github,以便处理本地机器上的文件。
发布于 2018-11-29 05:37:40
您首先应该确保您可以使用Git部署Cloudways应用程序(您已经在本地通过filezilla复制了该应用程序),并将其推送到GitHub回购程序中:
见"使用Git将代码部署到应用程序“。
一旦您的SSH访问设置完毕,您可以单击“开始部署”来启动该流程。它将获取GitHub回购,并进行部署。
这意味着,“是否可以将代码从cloudways应用程序部署到空的git存储库?”:不,发布过程正好相反。
这将涉及:
最后一步是:
/结束它。
如果将此字段保留为空,代码将被部署到public_html/。

发布于 2019-03-18 18:34:57
首先,在Github.com上创建一个空存储库。然后登录到Cloudways仪表板,打开应用程序并设置“通过Git进行部署”。当所有这些完成后,打开一个命令行应用程序(例如。并使用SSH凭据登录。接下来,您将执行一些Git命令:
首先,通过在git init目录中运行public_html命令,需要将服务器代码转换为本地存储库。这将创建一个.git子目录,该子目录包含新存储库所需的所有元数据。接下来,使用git add .创建快照,然后使用git commit -m "My Cloudways Repo"捕获快照的状态。My Cloudways Repo是这个初始提交的消息,可以是任何内容。然后,使用git remote add origin git@git.yourdomain.com:username/name_of_repo.git设置一个新的远程设备,这是您用来设置“通过Git进行部署”的相同地址。最后,您可以使用git push origin master将代码推送到远程Github服务器。
摘要:
使用命令行,导航到您的应用程序文件夹:/home/master/applications/yourdomain.com/public_html然后执行以下命令(一个接一个,以便您可以读取响应):
git init
git add .
git commit -m "My Second Repo Cloudways"
git remote add origin git@git.yourdomain.com:username/name_of_repo.git
git push origin master您可以在这里了解更多关于git init、git add和git commit的信息:
https://www.atlassian.com/git/tutorials/setting-up-a-repository https://www.cloudways.com/blog/wordpress-github/#create-repository-on-github
发布于 2020-11-28 11:00:38
首先,您需要在GitHub上创建一个新的存储库。然后,启动Cloudways SSH终端(服务器管理面板>主凭据>启动SSH终端)并粘贴您的凭据。现在运行以下命令:
cd applications/xxxxxx/public_html. xxxxxx is a folder name.
git init
git add .
git checkout -b master
git commit -m "first commit"如果您看到这条消息“请告诉我您是谁”,请运行以下两个命令
git config --global user.email "you@example.com" //
git config --global user.name "Your Name"
git remote add origin https://github.com/farhanayub/GitHub.git
git push origin master
Then insert GitHub username and password.如果您看到任何错误,请运行以下步骤并再次重复这些步骤。
rm -rf .git/https://stackoverflow.com/questions/53531626
复制相似问题