将git repo推送到digitalocean ubuntu 12服务器

时间:2014-11-22 14:56:05

标签: git github

我没有运气将我的应用程序文件推送到我的数字海洋服务器。我可以成功地将master推送到服务器但它进入了错误的文件夹。所有文件都在var/www文件夹中,但应该是var/www/html我不知道要更改什么以确保文件已提交到html

以下是我在终端中的内容:

terminal

和本地终端我有:

git remote add final ssh://jmccommas@104.131.73.151/var/www/repos/meanproject.git
git push final master

我错误的是文件没有进入/var/www/html目录?

2 个答案:

答案 0 :(得分:1)

您的存储库中的目录结构是什么?meanproject.git?

如果您的git repo没有html顶级目录,那么创建它并将文件克隆到其中:

cd /var/www
mkdir html
cd html
git clone <path to repo>

这假设您在repo中的文件是:

index.html
some-dir/
some-dir/your-image.gif

而不是

html/index.html
html/some-dir/
html/some-dir/your-image.gif

编辑:好的,看到你找到了自己的解决方案。

答案 1 :(得分:0)

我发现这是错误路径的收发后文件。它应该是:

#!/bin/sh GIT_WORK_TREE=/var/www/html git checkout -f

不是

#!/bin/sh GIT_WORK_TREE=/var/www git checkout -f 

愚蠢的错误就是!!